diff options
author | andrey@lmy004. <> | 2006-02-01 20:35:16 +0100 |
---|---|---|
committer | andrey@lmy004. <> | 2006-02-01 20:35:16 +0100 |
commit | 736faf473011dffd0fc0905c1d5e7859fa04c5aa (patch) | |
tree | 59375d95c601aec43e46d08deb88028599227821 /libmysql | |
parent | 04d6b7fa5435e7f4ea6843f0863ba060d054c64f (diff) | |
download | mariadb-git-736faf473011dffd0fc0905c1d5e7859fa04c5aa.tar.gz |
fix for bug #12744 (MYSQL_STMT operations cause seg fault after connection reset)
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 921f042922a..498881aa947 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4628,6 +4628,12 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) /* If statement hasnt been prepared there is nothing to reset */ if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) DBUG_RETURN(0); + if (!stmt->mysql) + { + /* mysql can be reset in mysql_close called from mysql_reconnect */ + set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate); + DBUG_RETURN(1); + } mysql= stmt->mysql->last_used_con; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ |