diff options
author | Hiroshi Inoue <inoue@tpf.co.jp> | 2002-03-11 10:25:57 +0000 |
---|---|---|
committer | Hiroshi Inoue <inoue@tpf.co.jp> | 2002-03-11 10:25:57 +0000 |
commit | dadb718b103d6675399547d3f6c12d0726f9537e (patch) | |
tree | 52a79b9c8affb5d5c4b7591516d470367483f60a /src/interfaces/odbc/connection.c | |
parent | d0d3ab532509c11c6f21ce189ad1ba44437baa62 (diff) | |
download | postgresql-dadb718b103d6675399547d3f6c12d0726f9537e.tar.gz postgresql-dadb718b103d6675399547d3f6c12d0726f9537e.zip |
Bug fixes for the 2002-03-08 change.
1) Put back the error message for SQLError().
2) Change Disallow premature to handle the SELECTed
result.
3) Put back the behavior of AUTUCOMMIT mode change.
4) Fix SQLColumns for ODBC3.0.
5) Improve the handling of variable bookmark in ODBC3.0.
6) Enable Recognize Unique Index Button.
Diffstat (limited to 'src/interfaces/odbc/connection.c')
-rw-r--r-- | src/interfaces/odbc/connection.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c index 44d7589496a..d176d925d4a 100644 --- a/src/interfaces/odbc/connection.c +++ b/src/interfaces/odbc/connection.c @@ -1322,7 +1322,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, BOOL clear_resu if ((swallow != '\0') || SOCK_get_errcode(sock) != 0) { self->errornumber = CONNECTION_BACKEND_CRAZY; - self->errormsg = "Unexpected protocol character from backend (send_query - I)"; + QR_set_message(res, "Unexpected protocol character from backend (send_query - I)"); QR_set_status(res, PGRES_FATAL_ERROR); ReadyToReturn = TRUE; retres = cmdres; @@ -1346,14 +1346,13 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, BOOL clear_resu if (msgbuffer[0] != '\0' && msgbuffer[strlen(msgbuffer) - 1] == '\n') msgbuffer[strlen(msgbuffer) - 1] = '\0'; - self->errormsg = msgbuffer; - mylog("send_query: 'E' - %s\n", self->errormsg); - qlog("ERROR from backend during send_query: '%s'\n", self->errormsg); + mylog("send_query: 'E' - %s\n", msgbuffer); + qlog("ERROR from backend during send_query: '%s'\n", msgbuffer); /* We should report that an error occured. Zoltan */ - if (!strncmp(self->errormsg, "FATAL", 5)) + if (!strncmp(msgbuffer, "FATAL", 5)) { self->errornumber = CONNECTION_SERVER_REPORTED_ERROR; CC_set_no_trans(self); @@ -1361,6 +1360,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, BOOL clear_resu else self->errornumber = CONNECTION_SERVER_REPORTED_WARNING; QR_set_status(res, PGRES_FATAL_ERROR); + QR_set_message(res, msgbuffer); QR_set_aborted(res, TRUE); aborted = TRUE; while (msg_truncated) @@ -1487,7 +1487,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, BOOL clear_resu retres = NULL; } } - else + if (retres) { /* * discard results other than errors. @@ -1501,6 +1501,11 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, BOOL clear_resu qres->next = NULL; QR_Destructor(qres); } + /* + * If error message isn't set + */ + if (retres && (!self->errormsg || !self->errormsg[0])) + self->errormsg = QR_get_message(retres); } } } |