diff options
author | Michael Meskes <meskes@postgresql.org> | 2003-05-30 13:22:02 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2003-05-30 13:22:02 +0000 |
commit | 776d5309240bdadc5f905cacba5f237e532c6139 (patch) | |
tree | c1567bb059c58296892817c779a9401694947826 /src/interfaces/ecpg/preproc | |
parent | a0fed291dcf39cd2191dfb49e1b30262e050de5f (diff) |
Create a real prototype function for describe.
Diffstat (limited to 'src/interfaces/ecpg/preproc')
-rw-r--r-- | src/interfaces/ecpg/preproc/output.c | 4 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 31 |
2 files changed, 18 insertions, 17 deletions
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c index 7e626b19716..57509ea809c 100644 --- a/src/interfaces/ecpg/preproc/output.c +++ b/src/interfaces/ecpg/preproc/output.c @@ -15,7 +15,7 @@ output_simple_statement(char *cmd) int i, j = strlen(cmd);; - /* do this char by char as we have to filter '\"' */ + /* output this char by char as we have to filter '\"' */ for (i = 0; i < j; i++) { if (cmd[i] != '"') @@ -111,7 +111,7 @@ output_statement(char *stmt, int mode, char *con) fprintf(yyout, "{ ECPGdo(__LINE__, %s, \"", con ? con : "NULL"); - /* do this char by char as we have to filter '\"' */ + /* output this char by char as we have to filter '\"' */ for (i = 0; i < j; i++) { if (stmt[i] != '"') diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index cb24adbb5db..e58a749b04d 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.226 2003/05/30 08:39:01 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.227 2003/05/30 13:22:02 meskes Exp $ */ /* Copyright comment */ %{ @@ -438,18 +438,17 @@ create_questionmarks(char *name, bool array) %type <str> ECPGFree ECPGDeclare ECPGVar opt_at enum_definition %type <str> struct_union_type s_struct_union vt_declarations %type <str> var_declaration type_declaration single_vt_declaration -%type <str> ECPGSetAutocommit on_off variable_declarations +%type <str> ECPGSetAutocommit on_off variable_declarations ECPGDescribe %type <str> ECPGAllocateDescr ECPGDeallocateDescr symbol opt_output %type <str> ECPGGetDescriptorHeader ECPGColLabel single_var_declaration %type <str> reserved_keyword unreserved_keyword ecpg_interval %type <str> col_name_keyword func_name_keyword precision opt_scale %type <str> ECPGTypeName variablelist ECPGColLabelCommon c_variable -%type <str> inf_val_list inf_col_list using_descriptor ECPGDescribe -%type <str> into_descriptor +%type <str> inf_val_list inf_col_list using_descriptor into_descriptor %type <struct_union> s_struct_union_symbol -%type <descriptor> ECPGGetDescriptor +%type <descriptor> ECPGGetDescriptor %type <type_enum> simple_type signed_type unsigned_type @@ -617,10 +616,12 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } } | ECPGDescribe { - if (connection) - mmerror(PARSE_ERROR, ET_ERROR, "no at option for describe statement.\n"); - - fprintf(yyout, "{ /* ECPGdescribe(__LINE__, %s) */;", $1); + fprintf(yyout, "{ ECPGdescribe(__LINE__, %s,", $1); + dump_variables(argsresult, 1); + fputs("ECPGt_EORT);", yyout); + fprintf(yyout, "}"); + output_line_number(); + /* whenever_action(2); */ free($1); } @@ -5186,18 +5187,18 @@ ECPGPrepare: PREPARE name FROM execstring */ ECPGDescribe: SQL_DESCRIBE INPUT_P name using_descriptor { - mmerror(PARSE_ERROR, ET_ERROR, "using unsupported describe statement.\n"); - $$ = cat_str(3, make_str("input"), $3, $4); + mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement.\n"); + $$ = cat_str(3, make_str("1, ECPGprepared_statement(\""), $3, make_str("\")")); } | SQL_DESCRIBE opt_output name using_descriptor { - mmerror(PARSE_ERROR, ET_ERROR, "using unsupported describe statement.\n"); - $$ = cat_str(3, $2, $3, $4); + mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement.\n"); + $$ = cat_str(3, make_str("0, ECPGprepared_statement(\""), $3, make_str("\")")); } | SQL_DESCRIBE opt_output name into_descriptor { - mmerror(PARSE_ERROR, ET_ERROR, "using unsupported describe statement.\n"); - $$ = cat_str(3, $2, $3, $4); + mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement.\n"); + $$ = cat_str(3, make_str("0, ECPGprepared_statement(\""), $3, make_str("\")")); } ; |