/*
* functions needed for descriptor handling
*
- * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.27 2008/05/16 15:20:04 petere Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.28 2009/01/23 12:43:32 petere Exp $
*
* since descriptor might be either a string constant or a string var
* we need to check for a constant if we expect a constant
fputs(name, yyout);
break;
default:
- mmerror(PARSE_ERROR, ET_ERROR, "variable %s: numeric type needed", name);
+ mmerror(PARSE_ERROR, ET_ERROR, "variable \"%s\" must have a numeric type", name);
break;
}
}
}
}
}
- mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor %s", name);
+ mmerror(PARSE_ERROR, ET_WARNING, "descriptor \"%s\" does not exist", name);
}
struct descriptor
return i;
}
}
- mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor %s", name);
+ mmerror(PARSE_ERROR, ET_WARNING, "descriptor \"%s\" does not exist", name);
return NULL;
}
if (results->value == ECPGd_count)
ECPGnumeric_lvalue(results->variable);
else
- mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor header item \"%d\"", results->value);
+ mmerror(PARSE_ERROR, ET_WARNING, "descriptor header item \"%d\" does not exist", results->value);
}
drop_assignments();
if (results->value == ECPGd_count)
ECPGnumeric_lvalue(results->variable);
else
- mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor header item \"%d\"", results->value);
+ mmerror(PARSE_ERROR, ET_WARNING, "descriptor header item \"%d\" does not exist", results->value);
}
drop_assignments();
case ECPGd_di_precision:
case ECPGd_precision:
case ECPGd_scale:
- mmerror(PARSE_ERROR, ET_FATAL, "descriptor item %s is not implemented",
+ mmerror(PARSE_ERROR, ET_FATAL, "descriptor item \"%s\" is not implemented",
descriptor_item_name(results->value));
break;
case ECPGd_octet:
case ECPGd_ret_length:
case ECPGd_ret_octet:
- mmerror(PARSE_ERROR, ET_FATAL, "descriptor item %s cannot be set",
+ mmerror(PARSE_ERROR, ET_FATAL, "descriptor item \"%s\" cannot be set",
descriptor_item_name(results->value));
break;
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.2 2008/12/29 17:07:05 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.3 2009/01/23 12:43:32 petere Exp $ */
ECPG: stmtClosePortalStmt block
{
if (pg_strcasecmp($1+strlen("close "), "database") == 0)
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for close database statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CLOSE DATABASE statement");
fprintf(yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
whenever_action(2);
ECPG: stmtDeallocateStmt block
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for deallocate statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in DEALLOCATE statement");
output_deallocate_prepare_statement($1);
}
| ECPGConnect
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for connect statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CONNECT statement");
fprintf(yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit);
reset_variables();
| ECPGDeallocateDescr
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for deallocate statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in DEALLOCATE statement");
fprintf(yyout,"ECPGdeallocate_desc(__LINE__, %s);",$1);
whenever_action(0);
free($1);
| ECPGDisconnect
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for disconnect statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in DISCONNECT statement");
fprintf(yyout, "{ ECPGdisconnect(__LINE__, %s);",
$1 ? $1 : "\"CURRENT\"");
| ECPGSetConnection
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for set connection statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in SET CONNECTION statement");
fprintf(yyout, "{ ECPGsetconn(__LINE__, %s);", $1);
whenever_action(2);
| ECPGTypedef
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for typedef statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in TYPE statement");
fprintf(yyout, "%s", $1);
free($1);
| ECPGVar
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for var statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in VAR statement");
output_simple_statement($1);
}
| ECPGWhenever
{
if (connection)
- mmerror(PARSE_ERROR, ET_ERROR, "no at option for whenever statement\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in WHENEVER statement");
output_simple_statement($1);
}
ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listopt_oidscopy_fromcopy_file_namecopy_delimiteropt_withcopy_opt_list addon
if (strcmp($6, "to") == 0 && strcmp($7, "stdin") == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "copy to stdin not possible\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
else if (strcmp($6, "from") == 0 && strcmp($7, "stdout") == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "copy from stdout not possible\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "COPY FROM STDOUT is not possible");
else if (strcmp($6, "from") == 0 && strcmp($7, "stdin") == 0)
- mmerror(PARSE_ERROR, ET_WARNING, "copy from stdin not implemented\n");
+ mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: CopyStmtCOPYselect_with_parensTOcopy_file_nameopt_withcopy_opt_list addon
if (strcmp($4, "stdin") == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "copy to stdin not possible\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
ECPG: ConstraintAttributeSpecConstraintDeferrabilitySpecConstraintTimeSpec addon
if (strcmp($1, "deferrable") != 0 && strcmp($2, "initially deferrable") == 0 )
- mmerror(PARSE_ERROR, ET_ERROR, "INITIALLY DEFERRED constraint must be DEFERRABLE\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "constraint declared INITIALLY DEFERRED must be DEFERRABLE");
ECPG: ConstraintAttributeSpecConstraintTimeSpecConstraintDeferrabilitySpec addon
if (strcmp($2, "deferrable") != 0 && strcmp($1, "initially deferrable") == 0 )
- mmerror(PARSE_ERROR, ET_ERROR, "INITIALLY DEFERRED constraint must be DEFERRABLE\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "constraint declared INITIALLY DEFERRED must be DEFERRABLE");
ECPG: var_valueNumericOnly addon
ECPG: fetch_directionSignedIconst addon
if ($1[0] == '$')
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
if (strcmp($2, ptr->name) == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" already defined\n", $2);
+ mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
}
this = (struct cursor *) mm_alloc(sizeof(struct cursor));
}
| ecpg_into { $$ = EMPTY; }
ECPG: table_refselect_with_parens addon
- mmerror(PARSE_ERROR, ET_ERROR, "sub-SELECT in FROM must have an alias\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "subquery in FROM must have an alias");
ECPG: TypenameSimpleTypenameopt_array_bounds block
{ $$ = cat2_str($1, $2.str); }
ECPG: TypenameSETOFSimpleTypenameopt_array_bounds block
| ECPGCKeywords { $$ = $1; }
ECPG: VariableShowStmtSHOWALL block
{
- mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL not implemented\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL is not implemented");
$$ = EMPTY;
}
ECPG: FetchStmtFETCHfetch_directionfrom_inname block
}
ECPG: SpecialRuleRelationOLD addon
if (!QueryIsRule)
- mmerror(PARSE_ERROR, ET_ERROR, "OLD used in non-rule query\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "OLD used in a query that is not in a rule");
ECPG: SpecialRuleRelationNEW addon
if (!QueryIsRule)
- mmerror(PARSE_ERROR, ET_ERROR, "NEW used in non-rule query\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "NEW used in a query that is not in a rule");
ECPG: select_limitLIMITselect_limit_value','select_offset_value block
{
- mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed to backend");
+ mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed to server");
$$ = cat_str(4, make_str("limit"), $2, make_str(","), $4);
}
ECPG: SignedIconstIconst rule
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.106 2008/12/11 07:34:09 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.107 2009/01/23 12:43:32 petere Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
progname);
printf(_("Options:\n"));
printf(_(" -c automatically generate C code from embedded SQL code;\n"
- " currently this works for EXEC SQL TYPE\n"));
- printf(_(" -C MODE set compatibility mode;\n"
- " MODE can be one of \"INFORMIX\", \"INFORMIX_SE\"\n"));
+ " this affects EXEC SQL TYPE\n"));
+ printf(_(" -C MODE set compatibility mode; MODE can be one of\n"
+ " \"INFORMIX\", \"INFORMIX_SE\"\n"));
#ifdef YYDEBUG
printf(_(" -d generate parser debug output\n"));
#endif
printf(_(" -i parse system include files as well\n"));
printf(_(" -I DIRECTORY search DIRECTORY for include files\n"));
printf(_(" -o OUTFILE write result to OUTFILE\n"));
- printf(_(" -r OPTION specify runtime behaviour;\n"
- " OPTION can be:\n"
- " \"no_indicator\"\n"
- " \"prepare\"\n"
- " \"questionmarks\"\n"));
+ printf(_(" -r OPTION specify run-time behavior; OPTION can be:\n"
+ " \"no_indicator\", \"prepare\", \"questionmarks\"\n"));
printf(_(" -t turn on autocommit of transactions\n"));
printf(_(" --help show this help, then exit\n"));
printf(_(" --regression run in regression testing mode\n"));
{
fprintf(stderr, _("%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n"),
progname, MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
- fprintf(stderr, _("exec sql include ... search starts here:\n"));
+ fprintf(stderr, _("EXEC SQL INCLUDE ... search starts here:\n"));
for (ip = include_paths; ip != NULL; ip = ip->next)
fprintf(stderr, " %s\n", ip->path);
fprintf(stderr, _("end of search list\n"));
/* and parse the source */
base_yyparse();
- /* check if all cursors were indeed opened */
- for (ptr = cur; ptr != NULL;)
- {
- char errortext[128];
-
+ /*
+ * Check whether all cursors were indeed opened. It
+ * does not really make sense to declare a cursor but
+ * not open it.
+ */
+ for (ptr = cur; ptr != NULL; ptr = ptr->next)
if (!(ptr->opened))
- {
- /*
- * Does not really make sense to declare a cursor but
- * not open it
- */
- snprintf(errortext, sizeof(errortext), _("cursor \"%s\" has been declared but not opened\n"), ptr->name);
- mmerror(PARSE_ERROR, ET_WARNING, errortext);
- }
- ptr = ptr->next;
- }
+ mmerror(PARSE_ERROR, ET_WARNING, "cursor \"%s\" has been declared but not opened", ptr->name);
if (yyin != NULL && yyin != stdin)
fclose(yyin);
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.4 2008/12/29 17:07:05 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.5 2009/01/23 12:43:32 petere Exp $ */
/* Copyright comment */
%{
if (ptr == NULL)
{
- mmerror(PARSE_ERROR, ET_ERROR, "trying to access an undeclared cursor \"%s\"\n", name);
+ mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" does not exist", name);
return NULL;
}
if ((type_enum == ECPGt_struct ||
type_enum == ECPGt_union) &&
initializer == 1)
- mmerror(PARSE_ERROR, ET_ERROR, "initializer not allowed in typedef command");
+ mmerror(PARSE_ERROR, ET_ERROR, "initializer not allowed in type definition");
else
{
for (ptr = types; ptr != NULL; ptr = ptr->next)
{
if (strcmp(name, ptr->name) == 0)
/* re-definition is a bug */
- mmerror(PARSE_ERROR, ET_ERROR, "type %s already defined", name);
+ mmerror(PARSE_ERROR, ET_ERROR, "type \"%s\" is already defined", name);
}
adjust_array(type_enum, &dimension, &length, type_dimension, type_index, array, true);
type_enum != ECPGt_char &&
type_enum != ECPGt_unsigned_char &&
atoi(this->type->type_index) >= 0)
- mmerror(PARSE_ERROR, ET_ERROR, "no multidimensional array support for simple data types");
+ mmerror(PARSE_ERROR, ET_ERROR, "multidimensional arrays for simple data types are not supported");
types = this;
}
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.3 2008/12/12 12:14:43 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.4 2009/01/23 12:43:32 petere Exp $ */
statements: /*EMPTY*/
| statements statement
CreateAsStmt: CREATE OptTemp TABLE create_as_target AS {FoundInto = 0;} SelectStmt opt_with_data
{
if (FoundInto == 1)
- mmerror(PARSE_ERROR, ET_ERROR, "CREATE TABLE / AS SELECT cannot specify INTO\n");
+ mmerror(PARSE_ERROR, ET_ERROR, "CREATE TABLE AS cannot specify INTO\n");
$$ = cat_str(6, make_str("create"), $2, make_str("table"), $4, make_str("as"), $7);
}
if (strncmp($1, "unix", strlen("unix")) == 0 &&
strncmp($3 + strlen("//"), "localhost", strlen("localhost")) != 0 &&
strncmp($3 + strlen("//"), "127.0.0.1", strlen("127.0.0.1")) != 0)
- mmerror(PARSE_ERROR, ET_ERROR, "unix domain sockets only work on \"localhost\" but not on \"%s\"", $3 + strlen("//"));
+ mmerror(PARSE_ERROR, ET_ERROR, "Unix-domain sockets only work on \"localhost\" but not on \"%s\"", $3 + strlen("//"));
$$ = make3_str(make3_str(make_str("\""), $1, make_str(":")), $3, make3_str(make3_str($4, make_str("/"), $6), $7, make_str("\"")));
}
mmerror(PARSE_ERROR, ET_ERROR, "expected \"postgresql\", found \"%s\"", $2);
if (strcmp($1, "tcp") != 0 && strcmp($1, "unix") != 0)
- mmerror(PARSE_ERROR, ET_ERROR, "illegal connection type %s", $1);
+ mmerror(PARSE_ERROR, ET_ERROR, "invalid connection type: %s", $1);
$$ = make3_str($1, make_str(":"), $2);
}
/* If we have just one character this is not a string */
if (atol(p->type->size) == 1)
- mmerror(PARSE_ERROR, ET_ERROR, "invalid datatype");
+ mmerror(PARSE_ERROR, ET_ERROR, "invalid data type");
else
{
/* if array see what's inside */
$$ = make2_str($1, make_str(".arr"));
break;
default:
- mmerror(PARSE_ERROR, ET_ERROR, "invalid datatype");
+ mmerror(PARSE_ERROR, ET_ERROR, "invalid data type");
$$ = $1;
break;
}
ECPGDescribe: SQL_DESCRIBE INPUT_P name using_descriptor
{
const char *con = connection ? connection : "NULL";
- mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement\n");
+ mmerror(PARSE_ERROR, ET_WARNING, "using unsupported DESCRIBE statement");
$$ = (char *) mm_alloc(sizeof("1, ECPGprepared_statement(, \"\", __LINE__)") + strlen(con) + strlen($3));
sprintf($$, "1, ECPGprepared_statement(%s, \"%s\", __LINE__)", con, $3);
}
| SQL_DESCRIBE opt_output name using_descriptor
{
const char *con = connection ? connection : "NULL";
- mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement\n");
+ mmerror(PARSE_ERROR, ET_WARNING, "using unsupported DESCRIBE statement");
$$ = (char *) mm_alloc(sizeof("0, ECPGprepared_statement(, \"\", __LINE__)") + strlen(con) + strlen($3));
sprintf($$, "0, ECPGprepared_statement(%s, \"%s\", __LINE__)", con, $3);
}
| SQL_DESCRIBE opt_output name into_descriptor
{
const char *con = connection ? connection : "NULL";
- mmerror(PARSE_ERROR, ET_WARNING, "using unsupported describe statement\n");
+ mmerror(PARSE_ERROR, ET_WARNING, "using unsupported DESCRIBE statement");
$$ = (char *) mm_alloc(sizeof("0, ECPGprepared_statement(, \"\", __LINE__)") + strlen(con) + strlen($3));
sprintf($$, "0, ECPGprepared_statement(%s, \"%s\", __LINE__)", con, $3);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.168 2009/01/01 17:24:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.169 2009/01/23 12:43:32 petere Exp $
*
*-------------------------------------------------------------------------
*/
yyless(1);
BEGIN(SQL);
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
- mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input");
+ mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string literal");
yylval.str = mm_strdup(literalbuf);
return BCONST;
}
<xb>{xbinside} { addlit(yytext, yyleng); }
<xh>{quotecontinue} |
<xb>{quotecontinue} { /* ignore */ }
-<xb><<EOF>> { mmerror(PARSE_ERROR, ET_FATAL, "unterminated bit string"); }
+<xb><<EOF>> { mmerror(PARSE_ERROR, ET_FATAL, "unterminated bit string literal"); }
<SQL>{xhstart} {
token_start = yytext;
return XCONST;
}
-<xh><<EOF>> { mmerror(PARSE_ERROR, ET_FATAL, "unterminated hexadecimal integer"); }
+<xh><<EOF>> { mmerror(PARSE_ERROR, ET_FATAL, "unterminated hexadecimal string literal"); }
<SQL>{xnstart} {
/* National character.
* Transfer it as-is to the backend.
BEGIN(state_before);
if (literallen == 0)
mmerror(PARSE_ERROR, ET_ERROR, "zero-length delimited identifier");
- /* The backend will truncate the idnetifier here. We do not as it does not change the result. */
+ /* The backend will truncate the identifier here. We do not as it does not change the result. */
yylval.str = mm_strdup(literalbuf);
return CSTRING;
}
BEGIN(state_before);
if (literallen == 2) /* "U&" */
mmerror(PARSE_ERROR, ET_ERROR, "zero-length delimited identifier");
- /* The backend will truncate the idnetifier here. We do not as it does not change the result. */
+ /* The backend will truncate the identifier here. We do not as it does not change the result. */
addlit(yytext, yyleng);
yylval.str = mm_strdup(literalbuf);
return UIDENT;
BEGIN(C);
}
<undef>{other}|\n {
- mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in 'EXEC SQL UNDEF' command");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in EXEC SQL UNDEF command");
yyterminate();
}
<C>{exec_sql}{include}{space}* { BEGIN(incl); }
}
<C,xskip>{exec_sql}{elif}{space}* { /* pop stack */
if ( preproc_tos == 0 ) {
- mmerror(PARSE_ERROR, ET_FATAL, "missing matching 'EXEC SQL IFDEF / EXEC SQL IFNDEF'");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
}
else if ( stacked_if_value[preproc_tos].else_branch )
- mmerror(PARSE_ERROR, ET_FATAL, "missing 'EXEC SQL ENDIF;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing \"EXEC SQL ENDIF;\"");
else
preproc_tos--;
if (INFORMIX_MODE)
{
if (preproc_tos == 0)
- mmerror(PARSE_ERROR, ET_FATAL, "missing matching 'EXEC SQL IFDEF / EXEC SQL IFNDEF'");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
else if (stacked_if_value[preproc_tos].else_branch)
- mmerror(PARSE_ERROR, ET_FATAL, "missing 'EXEC SQL ENDIF;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing \"EXEC SQL ENDIF;\"");
else
preproc_tos--;
<C,xskip>{exec_sql}{else}{space}*";" { /* only exec sql endif pops the stack, so take care of duplicated 'else' */
if (stacked_if_value[preproc_tos].else_branch)
- mmerror(PARSE_ERROR, ET_FATAL, "duplicated 'EXEC SQL ELSE;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "more than one EXEC SQL ELSE");
else
{
stacked_if_value[preproc_tos].else_branch = TRUE;
if (INFORMIX_MODE)
{
if (stacked_if_value[preproc_tos].else_branch)
- mmerror(PARSE_ERROR, ET_FATAL, "duplicated 'EXEC SQL ELSE;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "more than one EXEC SQL ELSE");
else
{
stacked_if_value[preproc_tos].else_branch = TRUE;
}
<C,xskip>{exec_sql}{endif}{space}*";" {
if (preproc_tos == 0)
- mmerror(PARSE_ERROR, ET_FATAL, "unmatched 'EXEC SQL ENDIF;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "unmatched EXEC SQL ENDIF");
else
preproc_tos--;
if (INFORMIX_MODE)
{
if (preproc_tos == 0)
- mmerror(PARSE_ERROR, ET_FATAL, "unmatched 'EXEC SQL ENDIF;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "unmatched EXEC SQL ENDIF");
else
preproc_tos--;
<xcond>{identifier}{space}*";" {
if (preproc_tos >= MAX_NESTED_IF-1)
- mmerror(PARSE_ERROR, ET_FATAL, "too many nested 'EXEC SQL IFDEF' conditions");
+ mmerror(PARSE_ERROR, ET_FATAL, "too many nested EXEC SQL IFDEF conditions");
else
{
struct _defines *defptr;
}
<xcond>{other}|\n {
- mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in 'EXEC SQL IFDEF' command");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in EXEC SQL IFDEF command");
yyterminate();
}
<def_ident>{identifier} {
startlit();
}
<def_ident>{other}|\n {
- mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in 'EXEC SQL DEFINE' command");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in EXEC SQL DEFINE command");
yyterminate();
}
<def>{space}*";" {
<incl>{dquote}{xdinside}{dquote}{space}*";"? { parse_include(); }
<incl>[^;\<\>\"]+";" { parse_include(); }
<incl>{other}|\n {
- mmerror(PARSE_ERROR, ET_FATAL, "incorrect 'EXEC SQL INCLUDE' command");
+ mmerror(PARSE_ERROR, ET_FATAL, "syntax error in EXEC SQL INCLUDE command");
yyterminate();
}
if ( preproc_tos > 0 )
{
preproc_tos = 0;
- mmerror(PARSE_ERROR, ET_FATAL, "missing 'EXEC SQL ENDIF;'");
+ mmerror(PARSE_ERROR, ET_FATAL, "missing \"EXEC SQL ENDIF;\"");
}
yyterminate();
}
}
}
-<INITIAL>{other}|\n { mmerror(PARSE_ERROR, ET_FATAL, "Internal error: unreachable state, please report this to <pgsql-bugs@postgresql.org>"); }
+<INITIAL>{other}|\n { mmerror(PARSE_ERROR, ET_FATAL, "internal error: unreachable state; please report this to <pgsql-bugs@postgresql.org>"); }
%%
void
lex_init(void)
{
if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH)
{
- fprintf(stderr, _("Error: Path %s/%s is too long on line %d, skipping\n"), ip->path, yytext, yylineno);
+ fprintf(stderr, _("Error: include path \"%s/%s\" is too long on line %d, skipping\n"), ip->path, yytext, yylineno);
continue;
}
snprintf (inc_file, sizeof(inc_file), "%s/%s", ip->path, yytext);
}
}
if (!yyin)
- mmerror(NO_INCLUDE_FILE, ET_FATAL, "cannot open include file \"%s\" on line %d\n", yytext, yylineno);
+ mmerror(NO_INCLUDE_FILE, ET_FATAL, "could not open include file \"%s\" on line %d", yytext, yylineno);
input_filename = mm_strdup(inc_file);
yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ));
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.81 2008/11/26 15:35:30 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.82 2009/01/23 12:43:32 petere Exp $ */
#include "postgres_fe.h"
void *ptr = malloc(size);
if (ptr == NULL)
- mmerror(OUT_OF_MEMORY, ET_FATAL, "out of memory\n");
+ mmerror(OUT_OF_MEMORY, ET_FATAL, "out of memory");
return ptr;
}
char *new = strdup(string);
if (new == NULL)
- mmerror(OUT_OF_MEMORY, ET_FATAL, "out of memory\n");
+ mmerror(OUT_OF_MEMORY, ET_FATAL, "out of memory");
return new;
}
return ("ECPGt_timestamp");
break;
default:
- mmerror(PARSE_ERROR, ET_ERROR, "illegal variable type %d\n", type);
+ mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %d", type);
}
return NULL;
{
case ECPGt_array:
if (indicator_set && ind_type->type != ECPGt_array)
- mmerror(INDICATOR_NOT_ARRAY, ET_FATAL, "indicator for array/pointer has to be array/pointer\n");
+ mmerror(INDICATOR_NOT_ARRAY, ET_FATAL, "indicator for array/pointer has to be array/pointer");
switch (type->u.element->type)
{
case ECPGt_array:
- mmerror(PARSE_ERROR, ET_ERROR, "no nested arrays allowed (except strings)"); /* array of array */
+ mmerror(PARSE_ERROR, ET_ERROR, "nested arrays are not supported (except strings)"); /* array of array */
break;
case ECPGt_struct:
case ECPGt_union:
break;
case ECPGt_struct:
if (indicator_set && ind_type->type != ECPGt_struct)
- mmerror(INDICATOR_NOT_STRUCT, ET_FATAL, "indicator for struct has to be struct\n");
+ mmerror(INDICATOR_NOT_STRUCT, ET_FATAL, "indicator for struct has to be a struct");
ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, NULL, prefix, ind_prefix);
break;
break;
case ECPGt_char_variable:
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
- mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "indicator for simple datatype has to be simple\n");
+ mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "indicator for simple data type has to be simple");
ECPGdump_a_simple(o, name, type->type, make_str("1"), (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("1"), struct_sizeof, prefix, 0);
if (ind_type != NULL)
break;
case ECPGt_descriptor:
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
- mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "indicator for simple datatype has to be simple\n");
+ mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "indicator for simple data type has to be simple");
ECPGdump_a_simple(o, name, type->type, NULL, make_str("-1"), NULL, prefix, 0);
if (ind_type != NULL)
break;
default:
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
- mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "indicator for simple datatype has to be simple\n");
+ mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "indicator for simple data type has to be simple");
ECPGdump_a_simple(o, name, type->type, type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), struct_sizeof, prefix, type->lineno);
if (ind_type != NULL)
ECPGfree_struct_member(type->u.members);
break;
default:
- mmerror(PARSE_ERROR, ET_ERROR, "illegal variable type %d\n", type->type);
+ mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %d", type->type);
break;
}
}
case ECPGd_cardinality:
return ("ECPGd_cardinality");
default:
- mmerror(PARSE_ERROR, ET_ERROR, "illegal descriptor item %d\n", type);
+ mmerror(PARSE_ERROR, ET_ERROR, "unrecognized descriptor item code %d", type);
}
return NULL;
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.45 2008/05/16 15:20:04 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.46 2009/01/23 12:43:32 petere Exp $ */
#include "postgres_fe.h"
case '\0': /* found the end, but this time it has to be
* an array element */
if (members->type->type != ECPGt_array)
- mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable %s", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable \"%s\"", name);
switch (members->type->u.element->type)
{
return (find_struct_member(name, end, members->type->u.members, brace_level));
break;
default:
- mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable %s", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable \"%s\"", name);
break;
}
}
if (c == '-')
{
if (p->type->type != ECPGt_array)
- mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not a pointer", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not a pointer", name);
if (p->type->u.element->type != ECPGt_struct && p->type->u.element->type != ECPGt_union)
- mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not a pointer to a structure or a union", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not a pointer to a structure or a union", name);
/* restore the name, we will need it later */
*next = c;
if (next == end)
{
if (p->type->type != ECPGt_struct && p->type->type != ECPGt_union)
- mmerror(PARSE_ERROR, ET_FATAL, "variable %s is neither a structure nor a union", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is neither a structure nor a union", name);
/* restore the name, we will need it later */
*next = c;
else
{
if (p->type->type != ECPGt_array)
- mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not an array", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not an array", name);
if (p->type->u.element->type != ECPGt_struct && p->type->u.element->type != ECPGt_union)
- mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not a pointer to a structure or a union", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not a pointer to a structure or a union", name);
/* restore the name, we will need it later */
*next = c;
check_indicator(var->u.element);
break;
default:
- mmerror(PARSE_ERROR, ET_ERROR, "indicator variable must be integer type");
+ mmerror(PARSE_ERROR, ET_ERROR, "indicator variable must have an integer type");
break;
}
}
for (this = types; this && strcmp(this->name, name); this = this->next);
if (!this)
- mmerror(PARSE_ERROR, ET_FATAL, "invalid datatype \"%s\"", name);
+ mmerror(PARSE_ERROR, ET_FATAL, "unrecognized data type name \"%s\"", name);
return (this);
}
if (atoi(type_index) >= 0)
{
if (atoi(*length) >= 0)
- mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
+ mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
*length = type_index;
}
if (atoi(type_dimension) >= 0)
{
if (atoi(*dimension) >= 0 && atoi(*length) >= 0)
- mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
+ mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
if (atoi(*dimension) >= 0)
*length = *dimension;
}
if (pointer_len > 2)
- mmerror(PARSE_ERROR, ET_FATAL, "no multilevel (more than 2) pointer supported %d", pointer_len);
+ mmerror(PARSE_ERROR, ET_FATAL, "multilevel pointers (more than 2 levels) are not supported; found %d levels", pointer_len);
if (pointer_len > 1 && type_enum != ECPGt_char && type_enum != ECPGt_unsigned_char)
- mmerror(PARSE_ERROR, ET_FATAL, "no pointer to pointer supported for this type");
+ mmerror(PARSE_ERROR, ET_FATAL, "pointer to pointer is not supported for this data type");
if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
- mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
+ mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
if (atoi(*length) >= 0 && atoi(*dimension) >= 0 && pointer_len)
- mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
+ mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
switch (type_enum)
{
}
if (atoi(*length) >= 0)
- mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support for structures");
+ mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays for structures are not supported");
break;
case ECPGt_varchar:
}
if (atoi(*length) >= 0)
- mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support for simple data types");
+ mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays for simple data types are not supported");
break;
}