summaryrefslogtreecommitdiff
path: root/libmysqld/lib_sql.cc
diff options
context:
space:
mode:
authorkroki/tomash@moonlight.intranet <>2006-11-17 12:33:59 +0300
committerkroki/tomash@moonlight.intranet <>2006-11-17 12:33:59 +0300
commit1f699a442238f8e7b79c9378379b7ae6ce0c6f22 (patch)
tree0d0aa7163e6996bd504d24973123ca780bfb99ab /libmysqld/lib_sql.cc
parent9bfc5f5772fa07cb9203b857317e9f6df7c39150 (diff)
parent6d4558f7c3d7c33e238b231ce65fade7e772f83e (diff)
downloadmariadb-git-1f699a442238f8e7b79c9378379b7ae6ce0c6f22.tar.gz
Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug23383
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-bug23383
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r--libmysqld/lib_sql.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index b5efd4a82af..769fdf9e94e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -278,24 +278,26 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
DBUG_ENTER("emb_stmt_execute");
char header[5];
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);
}