diff options
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r-- | libmysqld/lib_sql.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index a88c0b135db..97bcb9d87ca 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -278,26 +278,27 @@ static int emb_stmt_execute(MYSQL_STMT *stmt) { DBUG_ENTER("emb_stmt_execute"); char header[5]; - MYSQL_DATA *res; THD *thd; + my_bool res; int4store(header, stmt->stmt_id); header[4]= stmt->flags; thd= (THD*)stmt->mysql->thd; thd->client_param_count= stmt->param_count; thd->client_params= stmt->params; - if (emb_advanced_command(stmt->mysql, COM_STMT_EXECUTE,0,0, - header, sizeof(header), 1, stmt) || - emb_read_query_result(stmt->mysql)) + + res= test(emb_advanced_command(stmt->mysql, COM_STMT_EXECUTE, 0, 0, + header, sizeof(header), 1, stmt) || + emb_read_query_result(stmt->mysql)); + stmt->affected_rows= stmt->mysql->affected_rows; + stmt->insert_id= stmt->mysql->insert_id; + stmt->server_status= stmt->mysql->server_status; + if (res) { NET *net= &stmt->mysql->net; set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); DBUG_RETURN(1); } - stmt->affected_rows= stmt->mysql->affected_rows; - stmt->insert_id= stmt->mysql->insert_id; - stmt->server_status= stmt->mysql->server_status; - DBUG_RETURN(0); } |