Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3fcea50

Browse files
author
Hiroshi Inoue
committed
Fix a wrong error handling.
1 parent 9d4a45e commit 3fcea50

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/interfaces/odbc/connection.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
10471047
while (!clear)
10481048
{
10491049
id = SOCK_get_char(sock);
1050+
mylog("got clear id = '%c'\n", id);
10501051
switch (id)
10511052
{
10521053
case 'I':
@@ -1069,8 +1070,9 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
10691070
msg_truncated = SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH);
10701071
break;
10711072
case 'E':
1072-
msg_truncated = SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH);
1073-
qlog("ERROR from backend during clear: '%s'\n", cmdbuffer);
1073+
msg_truncated = SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH);
1074+
mylog("ERROR from backend during clear: '%s'\n", msgbuffer);
1075+
qlog("ERROR from backend during clear: '%s'\n", msgbuffer);
10741076

10751077
/*
10761078
* We must report this type of error as
@@ -1079,7 +1081,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
10791081
* from PostgreSQL 7.0). (Zoltan Kovacs,
10801082
* 04/26/2000)
10811083
*/
1082-
self->errormsg = cmdbuffer;
1084+
self->errormsg = msgbuffer;
10831085
if (!strncmp(self->errormsg, "FATAL", 5))
10841086
{
10851087
self->errornumber = CONNECTION_SERVER_REPORTED_ERROR;

0 commit comments

Comments
 (0)