diff options
author | Staale Smedseng <staale.smedseng@sun.com> | 2010-06-30 11:17:27 +0200 |
---|---|---|
committer | Staale Smedseng <staale.smedseng@sun.com> | 2010-06-30 11:17:27 +0200 |
commit | de7ca4eff2057ed72d4cf04d42f7b049992d8f14 (patch) | |
tree | 22b94ccf23c8cd723d59f5fabc4bb86c6a2ede9a /libmysql/libmysql.c | |
parent | de088c63ab027ac7899267287c3ba649be0b648e (diff) | |
parent | 18388d2105efe47f59e7a201154907ec9d7508df (diff) | |
download | mariadb-git-de7ca4eff2057ed72d4cf04d42f7b049992d8f14.tar.gz |
Automerge
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 901fa1f0c4c..17bb3297b97 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2127,7 +2127,12 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) stmt->insert_id= mysql->insert_id; if (res) { - set_stmt_errmsg(stmt, net); + /* + Don't set stmt error if stmt->mysql is NULL, as the error in this case + has already been set by mysql_prune_stmt_list(). + */ + if (stmt->mysql) + set_stmt_errmsg(stmt, net); DBUG_RETURN(1); } DBUG_RETURN(0); @@ -2338,7 +2343,12 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row) buff, sizeof(buff), (uchar*) 0, 0, 1, stmt)) { - set_stmt_errmsg(stmt, net); + /* + Don't set stmt error if stmt->mysql is NULL, as the error in this case + has already been set by mysql_prune_stmt_list(). + */ + if (stmt->mysql) + set_stmt_errmsg(stmt, net); return 1; } if ((*mysql->methods->read_rows_from_cursor)(stmt)) @@ -3025,7 +3035,12 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, buff, sizeof(buff), (uchar*) data, length, 1, stmt)) { - set_stmt_errmsg(stmt, &mysql->net); + /* + Don't set stmt error if stmt->mysql is NULL, as the error in this case + has already been set by mysql_prune_stmt_list(). + */ + if (stmt->mysql) + set_stmt_errmsg(stmt, &mysql->net); DBUG_RETURN(1); } } @@ -4440,7 +4455,12 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff), (uchar*) 0, 0, 1, stmt)) { - set_stmt_errmsg(stmt, net); + /* + Don't set stmt error if stmt->mysql is NULL, as the error in this case + has already been set by mysql_prune_stmt_list(). + */ + if (stmt->mysql) + set_stmt_errmsg(stmt, net); DBUG_RETURN(1); } } |