summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@quad.opbmk>2008-03-18 13:53:51 +0300
committerunknown <anozdrin/alik@quad.opbmk>2008-03-18 13:53:51 +0300
commitf77686df0d15757ee4003ec42e4d1268b1137dd5 (patch)
treeac3aa6164de2c626ea1a053059068240ca07a75e /sql-common
parentf20fe94b55727fbc69b1cb86af5dc96f216bdd87 (diff)
parent23d567aa7cb01811294a24ecda100d2a90fe8acf (diff)
downloadmariadb-git-f77686df0d15757ee4003ec42e4d1268b1137dd5.tar.gz
Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0
into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt-merged libmysql/libmysql.c: Auto merged sql-common/client.c: Auto merged tests/mysql_client_test.c: Manually merged.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index d4aceffe227..88774ce61e1 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -669,11 +669,12 @@ my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
const char *header, ulong header_length,
const char *arg, ulong arg_length, my_bool skip_check,
- MYSQL_STMT *stmt __attribute__((unused)))
+ MYSQL_STMT *stmt)
{
NET *net= &mysql->net;
my_bool result= 1;
init_sigpipe_variables
+ my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
DBUG_ENTER("cli_advanced_command");
/* Don't give sigpipe errors if the client doesn't want them */
@@ -681,7 +682,7 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
if (mysql->net.vio == 0)
{ /* Do reconnect if possible */
- if (mysql_reconnect(mysql))
+ if (mysql_reconnect(mysql) || stmt_skip)
DBUG_RETURN(1);
}
if (mysql->status != MYSQL_STATUS_READY ||
@@ -712,7 +713,7 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
goto end;
}
end_server(mysql);
- if (mysql_reconnect(mysql))
+ if (mysql_reconnect(mysql) || stmt_skip)
goto end;
if (net_write_command(net,(uchar) command, header, header_length,
arg, arg_length))
@@ -2518,6 +2519,9 @@ my_bool mysql_reconnect(MYSQL *mysql)
if (stmt->state != MYSQL_STMT_INIT_DONE)
{
stmt->mysql= 0;
+ stmt->last_errno= CR_SERVER_LOST;
+ strmov(stmt->last_error, ER(CR_SERVER_LOST));
+ strmov(stmt->sqlstate, unknown_sqlstate);
}
else
{