diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-03-06 06:10:59 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-03-06 06:10:59 +0000 |
| commit | 92288a1cf9490be3835dc8524ee2ba407f1b885a (patch) | |
| tree | c4fe79ee2cb5cb8fa3385580c6cf431a97c2fc48 /src/interfaces | |
| parent | 22ebad9e39e268c9d4c6c2e422af727058830089 (diff) | |
| download | postgresql-92288a1cf9490be3835dc8524ee2ba407f1b885a.tar.gz | |
Change made to elog:
o Change all current CVS messages of NOTICE to WARNING. We were going
to do this just before 7.3 beta but it has to be done now, as you will
see below.
o Change current INFO messages that should be controlled by
client_min_messages to NOTICE.
o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc.
to always go to the client.
o Remove INFO from the client_min_messages options and add NOTICE.
Seems we do need three non-ERROR elog levels to handle the various
behaviors we need for these messages.
Regression passed.
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/ecpg/include/ecpgerrno.h | 28 | ||||
| -rw-r--r-- | src/interfaces/ecpg/lib/connect.c | 64 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/descriptor.c | 10 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 26 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/type.h | 2 | ||||
| -rw-r--r-- | src/interfaces/ecpg/test/test_notice.pgc | 14 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-exec.c | 14 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-misc.c | 6 | ||||
| -rw-r--r-- | src/interfaces/odbc/connection.c | 24 |
10 files changed, 96 insertions, 96 deletions
diff --git a/src/interfaces/ecpg/include/ecpgerrno.h b/src/interfaces/ecpg/include/ecpgerrno.h index 189f1db910..545782e2a6 100644 --- a/src/interfaces/ecpg/include/ecpgerrno.h +++ b/src/interfaces/ecpg/include/ecpgerrno.h @@ -44,23 +44,23 @@ #define ECPG_TRANS -401 #define ECPG_CONNECT -402 -/* backend notices, starting at 600 */ -#define ECPG_NOTICE_UNRECOGNIZED -600 - /* NOTICE: (transaction aborted): queries ignored until END */ +/* backend WARNINGs, starting at 600 */ +#define ECPG_WARNING_UNRECOGNIZED -600 + /* WARNING: (transaction aborted): queries ignored until END */ /* - * NOTICE: current transaction is aborted, queries ignored until end of + * WARNING: current transaction is aborted, queries ignored until end of * transaction block */ -#define ECPG_NOTICE_QUERY_IGNORED -601 - /* NOTICE: PerformPortalClose: portal "*" not found */ -#define ECPG_NOTICE_UNKNOWN_PORTAL -602 - /* NOTICE: BEGIN: already a transaction in progress */ -#define ECPG_NOTICE_IN_TRANSACTION -603 - /* NOTICE: AbortTransaction and not in in-progress state */ - /* NOTICE: COMMIT: no transaction in progress */ -#define ECPG_NOTICE_NO_TRANSACTION -604 - /* NOTICE: BlankPortalAssignName: portal * already exists */ -#define ECPG_NOTICE_PORTAL_EXISTS -605 +#define ECPG_WARNING_QUERY_IGNORED -601 + /* WARNING: PerformPortalClose: portal "*" not found */ +#define ECPG_WARNING_UNKNOWN_PORTAL -602 + /* WARNING: BEGIN: already a transaction in progress */ +#define ECPG_WARNING_IN_TRANSACTION -603 + /* WARNING: AbortTransaction and not in in-progress state */ + /* WARNING: COMMIT: no transaction in progress */ +#define ECPG_WARNING_NO_TRANSACTION -604 + /* WARNING: BlankPortalAssignName: portal * already exists */ +#define ECPG_WARNING_PORTAL_EXISTS -605 #endif /* !_ECPG_ERROR_H */ diff --git a/src/interfaces/ecpg/lib/connect.c b/src/interfaces/ecpg/lib/connect.c index cb35a08ca2..ae53972e5c 100644 --- a/src/interfaces/ecpg/lib/connect.c +++ b/src/interfaces/ecpg/lib/connect.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/connect.c,v 1.17 2001/12/23 12:17:41 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/connect.c,v 1.18 2002/03/06 06:10:35 momjian Exp $ */ #include "postgres_fe.h" @@ -142,117 +142,117 @@ static void ECPGnoticeProcessor(void *arg, const char *message) { /* these notices raise an error */ - if (strncmp(message, "NOTICE: ", 8)) + if (strncmp(message, "WARNING: ", 9)) { - ECPGlog("ECPGnoticeProcessor: strange notice '%s'\n", message); - ECPGnoticeProcessor_raise(ECPG_NOTICE_UNRECOGNIZED, message); + ECPGlog("ECPGnoticeProcessor: strange warning '%s'\n", message); + ECPGnoticeProcessor_raise(ECPG_WARNING_UNRECOGNIZED, message); return; } message += 8; while (*message == ' ') message++; - ECPGlog("NOTICE: %s", message); + ECPGlog("WARNING: %s", message); - /* NOTICE: (transaction aborted): queries ignored until END */ + /* WARNING: (transaction aborted): queries ignored until END */ /* - * NOTICE: current transaction is aborted, queries ignored until end + * WARNING: current transaction is aborted, queries ignored until end * of transaction block */ if (strstr(message, "queries ignored") && strstr(message, "transaction") && strstr(message, "aborted")) { - ECPGnoticeProcessor_raise(ECPG_NOTICE_QUERY_IGNORED, message); + ECPGnoticeProcessor_raise(ECPG_WARNING_QUERY_IGNORED, message); return; } - /* NOTICE: PerformPortalClose: portal "*" not found */ + /* WARNING: PerformPortalClose: portal "*" not found */ if ((!strncmp(message, "PerformPortalClose: portal", 26) || !strncmp(message, "PerformPortalFetch: portal", 26)) && strstr(message + 26, "not found")) { - ECPGnoticeProcessor_raise(ECPG_NOTICE_UNKNOWN_PORTAL, message); + ECPGnoticeProcessor_raise(ECPG_WARNING_UNKNOWN_PORTAL, message); return; } - /* NOTICE: BEGIN: already a transaction in progress */ + /* WARNING: BEGIN: already a transaction in progress */ if (!strncmp(message, "BEGIN: already a transaction in progress", 40)) { - ECPGnoticeProcessor_raise(ECPG_NOTICE_IN_TRANSACTION, message); + ECPGnoticeProcessor_raise(ECPG_WARNING_IN_TRANSACTION, message); return; } - /* NOTICE: AbortTransaction and not in in-progress state */ - /* NOTICE: COMMIT: no transaction in progress */ - /* NOTICE: ROLLBACK: no transaction in progress */ + /* WARNING: AbortTransaction and not in in-progress state */ + /* WARNING: COMMIT: no transaction in progress */ + /* WARNING: ROLLBACK: no transaction in progress */ if (!strncmp(message, "AbortTransaction and not in in-progress state", 45) || !strncmp(message, "COMMIT: no transaction in progress", 34) || !strncmp(message, "ROLLBACK: no transaction in progress", 36)) { - ECPGnoticeProcessor_raise(ECPG_NOTICE_NO_TRANSACTION, message); + ECPGnoticeProcessor_raise(ECPG_WARNING_NO_TRANSACTION, message); return; } - /* NOTICE: BlankPortalAssignName: portal * already exists */ + /* WARNING: BlankPortalAssignName: portal * already exists */ if (!strncmp(message, "BlankPortalAssignName: portal", 29) && strstr(message + 29, "already exists")) { - ECPGnoticeProcessor_raise(ECPG_NOTICE_PORTAL_EXISTS, message); + ECPGnoticeProcessor_raise(ECPG_WARNING_PORTAL_EXISTS, message); return; } /* these are harmless - do nothing */ /* - * NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index '*' + * WARNING: CREATE TABLE / PRIMARY KEY will create implicit index '*' * for table '*' */ /* - * NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit + * WARNING: ALTER TABLE ... ADD CONSTRAINT will create implicit * trigger(s) for FOREIGN KEY check(s) */ /* - * NOTICE: CREATE TABLE will create implicit sequence '*' for SERIAL + * WARNING: CREATE TABLE will create implicit sequence '*' for SERIAL * column '*.*' */ /* - * NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN + * WARNING: CREATE TABLE will create implicit trigger(s) for FOREIGN * KEY check(s) */ if ((!strncmp(message, "CREATE TABLE", 12) || !strncmp(message, "ALTER TABLE", 11)) && strstr(message + 11, "will create implicit")) return; - /* NOTICE: QUERY PLAN: */ + /* WARNING: QUERY PLAN: */ if (!strncmp(message, "QUERY PLAN:", 11)) /* do we really see these? */ return; /* - * NOTICE: DROP TABLE implicitly drops referential integrity trigger + * WARNING: DROP TABLE implicitly drops referential integrity trigger * from table "*" */ if (!strncmp(message, "DROP TABLE implicitly drops", 27)) return; /* - * NOTICE: Caution: DROP INDEX cannot be rolled back, so don't abort + * WARNING: Caution: DROP INDEX cannot be rolled back, so don't abort * now */ if (strstr(message, "cannot be rolled back")) return; /* these and other unmentioned should set sqlca.sqlwarn[2] */ - /* NOTICE: The ':' operator is deprecated. Use exp(x) instead. */ - /* NOTICE: Rel *: Uninitialized page 0 - fixing */ - /* NOTICE: PortalHeapMemoryFree: * not in alloc set! */ - /* NOTICE: Too old parent tuple found - can't continue vc_repair_frag */ - /* NOTICE: identifier "*" will be truncated to "*" */ - /* NOTICE: InvalidateSharedInvalid: cache state reset */ - /* NOTICE: RegisterSharedInvalid: SI buffer overflow */ + /* WARNING: The ':' operator is deprecated. Use exp(x) instead. */ + /* WARNING: Rel *: Uninitialized page 0 - fixing */ + /* WARNING: PortalHeapMemoryFree: * not in alloc set! */ + /* WARNING: Too old parent tuple found - can't continue vc_repair_frag */ + /* WARNING: identifier "*" will be truncated to "*" */ + /* WARNING: InvalidateSharedInvalid: cache state reset */ + /* WARNING: RegisterSharedInvalid: SI buffer overflow */ sqlca.sqlwarn[2] = 'W'; sqlca.sqlwarn[0] = 'W'; } diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c index e542bcece0..c6bfa01c2f 100644 --- a/src/interfaces/ecpg/preproc/descriptor.c +++ b/src/interfaces/ecpg/preproc/descriptor.c @@ -121,7 +121,7 @@ drop_descriptor(char *name, char *connection) } } snprintf(errortext, sizeof errortext, "unknown descriptor %s", name); - mmerror(PARSE_ERROR, ET_NOTICE, errortext); + mmerror(PARSE_ERROR, ET_WARNING, errortext); } struct descriptor @@ -144,7 +144,7 @@ lookup_descriptor(char *name, char *connection) } } snprintf(errortext, sizeof errortext, "unknown descriptor %s", name); - mmerror(PARSE_ERROR, ET_NOTICE, errortext); + mmerror(PARSE_ERROR, ET_WARNING, errortext); return NULL; } @@ -161,7 +161,7 @@ output_get_descr_header(char *desc_name) else { snprintf(errortext, sizeof errortext, "unknown descriptor header item '%d'", results->value); - mmerror(PARSE_ERROR, ET_NOTICE, errortext); + mmerror(PARSE_ERROR, ET_WARNING, errortext); } } @@ -183,10 +183,10 @@ output_get_descr(char *desc_name, char *index) switch (results->value) { case ECPGd_nullable: - mmerror(PARSE_ERROR, ET_NOTICE, "nullable is always 1"); + mmerror(PARSE_ERROR, ET_WARNING, "nullable is always 1"); break; case ECPGd_key_member: - mmerror(PARSE_ERROR, ET_NOTICE, "key_member is always 0"); + mmerror(PARSE_ERROR, ET_WARNING, "key_member is always 0"); break; default: break; diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 93f26c292e..15e79c9196 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.85 2002/02/15 17:46:57 petere Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.86 2002/03/06 06:10:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -394,7 +394,7 @@ cppline {space}*#(.*\\{space})*.* literalbuf, NAMEDATALEN-1, literalbuf); literalbuf[NAMEDATALEN-1] = '\0'; #endif - mmerror(PARSE_ERROR, ET_NOTICE, errortext); + mmerror(PARSE_ERROR, ET_WARNING, errortext); } yylval.str = mm_strdup(literalbuf); diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index d94f2a78c5..550d15ca12 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -38,7 +38,7 @@ mmerror(int error_code, enum errortype type, char * error) { switch(type) { - case ET_NOTICE: + case ET_WARNING: fprintf(stderr, "%s:%d: WARNING: %s\n", input_filename, yylineno, error); break; case ET_ERROR: @@ -1101,11 +1101,11 @@ OptTemp: TEMPORARY { $$ = make_str("temporary"); } | LOCAL TEMPORARY { $$ = make_str("local temporary"); } | LOCAL TEMP { $$ = make_str("local temp"); } | GLOBAL TEMPORARY { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported CREATE TABLE / GLOBAL TEMPORARY will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported CREATE TABLE / GLOBAL TEMPORARY will be passed to backend"); $$ = make_str("global temporary"); } | GLOBAL TEMP { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported CREATE TABLE / GLOBAL TEMP will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported CREATE TABLE / GLOBAL TEMP will be passed to backend"); $$ = make_str("global temp"); } | /*EMPTY*/ { $$ = EMPTY; } @@ -1131,7 +1131,7 @@ columnDef: ColId Typename ColQualList opt_collate if (strlen($4) > 0) { sprintf(errortext, "Currently unsupported CREATE TABLE / COLLATE %s will be passed to backend", $4); - mmerror(PARSE_ERROR, ET_NOTICE, errortext); + mmerror(PARSE_ERROR, ET_WARNING, errortext); } $$ = cat_str(4, $1, $2, $3, $4); } @@ -1246,7 +1246,7 @@ key_match: MATCH FULL } | MATCH PARTIAL { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported FOREIGN KEY/MATCH PARTIAL will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported FOREIGN KEY/MATCH PARTIAL will be passed to backend"); $$ = make_str("match partial"); } | /*EMPTY*/ @@ -1641,7 +1641,7 @@ direction: FORWARD { $$ = make_str("forward"); } | BACKWARD { $$ = make_str("backward"); } | RELATIVE { $$ = make_str("relative"); } | ABSOLUTE { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported FETCH/ABSOLUTE will be passed to backend, backend will use RELATIVE"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported FETCH/ABSOLUTE will be passed to backend, backend will use RELATIVE"); $$ = make_str("absolute"); } ; @@ -1798,7 +1798,7 @@ grantee_list: grantee { $$ = $1; } opt_with_grant: WITH GRANT OPTION { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported GRANT/WITH GRANT OPTION will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported GRANT/WITH GRANT OPTION will be passed to backend"); $$ = make_str("with grant option"); } | /*EMPTY*/ { $$ = EMPTY; } @@ -1950,12 +1950,12 @@ func_arg: opt_arg func_type opt_arg: IN { $$ = make_str("in"); } | OUT { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported CREATE FUNCTION/OUT will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported CREATE FUNCTION/OUT will be passed to backend"); $$ = make_str("out"); } | INOUT { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported CREATE FUNCTION/INOUT will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported CREATE FUNCTION/INOUT will be passed to backend"); $$ = make_str("inout"); } @@ -2195,7 +2195,7 @@ opt_trans: WORK { $$ = ""; } opt_chain: AND NO CHAIN { $$ = make_str("and no chain"); } | AND CHAIN { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported COMMIT/CHAIN will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported COMMIT/CHAIN will be passed to backend"); $$ = make_str("and chain"); } @@ -2640,12 +2640,12 @@ OptTempTableName: TEMPORARY opt_table relation_name } | GLOBAL TEMPORARY opt_table relation_name { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported CREATE TABLE / GLOBAL TEMPORARY will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported CREATE TABLE / GLOBAL TEMPORARY will be passed to backend"); $$ = cat_str(3, make_str("global temporary"), $3, $4); } | GLOBAL TEMP opt_table relation_name { - mmerror(PARSE_ERROR, ET_NOTICE, "Currently unsupported CREATE TABLE / GLOBAL TEMP will be passed to backend"); + mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported CREATE TABLE / GLOBAL TEMP will be passed to backend"); $$ = cat_str(3, make_str("global temp"), $3, $4); } | TABLE relation_name @@ -2704,7 +2704,7 @@ select_limit: LIMIT select_limit_value OFFSET select_offset_value | LIMIT select_limit_value ',' select_offset_value { $$ = cat_str(4, make_str("limit"), $2, make_str(","), $4); } /* enable this in 7.3, bjm 2001-10-22 - { mmerror(PARSE_ERROR, ET_NOTICE, "No longer supported LIMIT #,# syntax passed to backend."); } + { mmerror(PARSE_ERROR, ET_WARNING, "No longer supported LIMIT #,# syntax passed to backend."); } */ ; diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h index e07dfc54f3..d86f08b64d 100644 --- a/src/interfaces/ecpg/preproc/type.h +++ b/src/interfaces/ecpg/preproc/type.h @@ -156,7 +156,7 @@ struct assignment enum errortype { - ET_NOTICE, ET_ERROR, ET_FATAL + ET_WARNING, ET_ERROR, ET_FATAL }; struct fetch_desc diff --git a/src/interfaces/ecpg/test/test_notice.pgc b/src/interfaces/ecpg/test/test_notice.pgc index 6ea6d4e241..be674b7378 100644 --- a/src/interfaces/ecpg/test/test_notice.pgc +++ b/src/interfaces/ecpg/test/test_notice.pgc @@ -1,4 +1,4 @@ -// $Id: test_notice.pgc,v 1.2 2001/08/11 10:52:09 petere Exp $ +// $Id: test_notice.pgc,v 1.3 2002/03/06 06:10:41 momjian Exp $ exec sql include sqlca; @@ -43,16 +43,16 @@ int main(int argc, char **argv) if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql begin work; - if (sqlca.sqlcode!=ECPG_NOTICE_IN_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); + if (sqlca.sqlcode!=ECPG_WARNING_IN_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql commit; if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql commit; - if (sqlca.sqlcode!=ECPG_NOTICE_NO_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); + if (sqlca.sqlcode!=ECPG_WARNING_NO_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql rollback; - if (sqlca.sqlcode!=ECPG_NOTICE_NO_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); + if (sqlca.sqlcode!=ECPG_WARNING_NO_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); sqlca.sqlcode=0; exec sql declare x cursor for select * from test; @@ -62,19 +62,19 @@ int main(int argc, char **argv) if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql open x; - if (sqlca.sqlcode!=ECPG_NOTICE_PORTAL_EXISTS) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); + if (sqlca.sqlcode!=ECPG_WARNING_PORTAL_EXISTS) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql close x; if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql close x; - if (sqlca.sqlcode!=ECPG_NOTICE_UNKNOWN_PORTAL) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); + if (sqlca.sqlcode!=ECPG_WARNING_UNKNOWN_PORTAL) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql update test set nonexistent=2; if (sqlca.sqlcode!=ECPG_PGSQL) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql select payload into :payload from test where index=1; - if (sqlca.sqlcode!=ECPG_NOTICE_QUERY_IGNORED) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); + if (sqlca.sqlcode!=ECPG_WARNING_QUERY_IGNORED) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exec sql rollback; if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 11d329e153..462d9c2d2d 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.116 2002/03/05 06:07:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.117 2002/03/06 06:10:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -202,16 +202,16 @@ PQescapeBytea(unsigned char *bintext, size_t binlen, size_t *bytealen) * 6 \\ */ unsigned char * -PQunescapeBytea(unsigned char *strtext, size_t *retbuflen) +PQunescapeBytea(unsigned char *strtext, size_t *retbuflen) { size_t buflen; unsigned char *buffer, *sp, *bp; unsigned int state=0; - if(strtext == NULL)return NULL; + if(strtext == NULL)return NULL; buflen = strlen(strtext); /* will shrink, also we discover if strtext */ buffer = (unsigned char *) malloc(buflen); /* isn't NULL terminated */ - if(buffer == NULL)return NULL; + if(buffer == NULL)return NULL; for(bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++) { switch(state) @@ -798,7 +798,7 @@ PQsendQuery(PGconn *conn, const char *query) * handleSendFailure: try to clean up after failure to send command. * * Primarily, what we want to accomplish here is to process an async - * NOTICE message that the backend might have sent just before it died. + * WARNING message that the backend might have sent just before it died. * * NOTE: this routine should only be called in PGASYNC_IDLE state. */ @@ -816,7 +816,7 @@ handleSendFailure(PGconn *conn) /* * Parse any available input messages. Since we are in PGASYNC_IDLE - * state, only NOTICE and NOTIFY messages will be eaten. + * state, only WARNING and NOTIFY messages will be eaten. */ parseInput(conn); } @@ -890,7 +890,7 @@ parseInput(PGconn *conn) return; /* - * NOTIFY and NOTICE messages can happen in any state besides COPY + * NOTIFY and WARNING messages can happen in any state besides COPY * OUT; always process them right away. * * Most other messages should only be processed while in BUSY state. diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 3403a8ca5b..5f90547d60 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -25,7 +25,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.67 2002/03/05 06:07:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.68 2002/03/06 06:10:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -122,7 +122,7 @@ pqPutBytes(const char *s, size_t nbytes, PGconn *conn) while (nbytes) { size_t avail, remaining; - + /* fill the output buffer */ avail = Max(conn->outBufSize - conn->outCount, 0); remaining = Min(avail, nbytes); @@ -703,7 +703,7 @@ pqSendSome(PGconn *conn) /* * We used to close the socket here, but that's a bad * idea since there might be unread data waiting - * (typically, a NOTICE message from the backend + * (typically, a WARNING message from the backend * telling us it's committing hara-kiri...). Leave * the socket open until pqReadData finds no more data * can be read. diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c index 389da5698a..3d07474a56 100644 --- a/src/interfaces/odbc/connection.c +++ b/src/interfaces/odbc/connection.c @@ -578,12 +578,12 @@ md5_auth_send(ConnectionClass *self, const char *salt) { free(pwd1); return 1; - } + } if (!(pwd2 = malloc(MD5_PASSWD_LEN + 1))) { free(pwd1); return 1; - } + } if (!EncryptMD5(pwd1 + strlen("md5"), salt, 4, pwd2)) { free(pwd2); @@ -595,7 +595,7 @@ md5_auth_send(ConnectionClass *self, const char *salt) SOCK_put_n_char(sock, pwd2, strlen(pwd2) + 1); SOCK_flush_output(sock); free(pwd2); - return 0; + return 0; } char @@ -1199,7 +1199,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi) { mylog("send_query: ok - 'C' - %s\n", cmdbuffer); - if (res == NULL) /* allow for "show" style notices */ + if (res == NULL) /* allow for "show" style info */ res = QR_Constructor(); mylog("send_query: setting cmdbuffer = '%s'\n", cmdbuffer); @@ -1243,7 +1243,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi) ReadyToReturn = FALSE; } break; - case 'N': /* NOTICE: */ + case 'N': /* INFO, NOTICE, WARNING */ msg_truncated = SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH); if (!res) res = QR_Constructor(); @@ -1257,19 +1257,19 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi) strcpy(PG_CCSS, cmdbuffer + 36);
if (strstr(cmdbuffer,"Current server encoding is"))
strcpy(PG_SCSS, cmdbuffer + 36);
- mylog("~~~ NOTICE: '%s'\n", cmdbuffer);
- qlog("NOTICE from backend during send_query: '%s'\n ClientEncoding = %s\n ServerEncoding = %s\n", cmdbuffer, PG_CCSS, PG_SCSS);
+ mylog("~~~ WARNING: '%s'\n", cmdbuffer);
+ qlog("WARNING from backend during send_query: '%s'\n ClientEncoding = %s\n ServerEncoding = %s\n", cmdbuffer, PG_CCSS, PG_SCSS);
}
else
{
- mylog("~~~ NOTICE: '%s'\n", cmdbuffer);
- qlog("NOTICE from backend during send_query: '%s'\n", cmdbuffer);
+ mylog("~~~ WARNING: '%s'\n", cmdbuffer);
+ qlog("WARNING from backend during send_query: '%s'\n", cmdbuffer);
}
#else
- mylog("~~~ NOTICE: '%s'\n", cmdbuffer);
- qlog("NOTICE from backend during send_query: '%s'\n", cmdbuffer);
+ mylog("~~~ WARNING: '%s'\n", cmdbuffer);
+ qlog("WARNING from backend during send_query: '%s'\n", cmdbuffer);
#endif while (msg_truncated) msg_truncated = SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH); @@ -1591,7 +1591,7 @@ CC_send_function(ConnectionClass *self, int fnid, void *result_buf, int *actual_ SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); mylog("send_function(G): 'N' - %s\n", msgbuffer); - qlog("NOTICE from backend during send_function: '%s'\n", msgbuffer); + qlog("WARNING from backend during send_function: '%s'\n", msgbuffer); continue; /* dont return a result -- continue * reading */ |
