diff options
author | unknown <serg@janus.mylan> | 2007-12-20 22:11:37 +0100 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2007-12-20 22:11:37 +0100 |
commit | 295732b580716b6b5a48a4a2ceb112b432c96551 (patch) | |
tree | 8e1c37da4cf89e91d901badb1c2e5f100be39ec1 /sql/sql_prepare.cc | |
parent | 3ab83a2e5efdb64b068243d11b6230ae5b11df29 (diff) | |
parent | 9bf488563d948ddc86ccef87ddaebc7d15afe1a4 (diff) | |
download | mariadb-git-295732b580716b6b5a48a4a2ceb112b432c96551.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into janus.mylan:/usr/home/serg/Abk/mysql-5.1
configure.in:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/t/information_schema.test:
Auto merged
sql/Makefile.am:
Auto merged
sql/field.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_geofunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/key.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/protocol.h:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.h:
Auto merged
storage/archive/ha_archive.cc:
Auto merged
storage/innobase/buf/buf0buf.c:
Auto merged
storage/innobase/buf/buf0flu.c:
Auto merged
storage/innobase/buf/buf0lru.c:
Auto merged
storage/innobase/include/buf0buf.h:
Auto merged
storage/innobase/include/buf0buf.ic:
Auto merged
storage/innobase/include/sync0arr.h:
Auto merged
storage/innobase/include/sync0rw.h:
Auto merged
storage/innobase/include/sync0rw.ic:
Auto merged
storage/innobase/include/sync0sync.h:
Auto merged
storage/innobase/os/os0sync.c:
Auto merged
storage/innobase/sync/sync0arr.c:
Auto merged
storage/innobase/sync/sync0rw.c:
Auto merged
storage/innobase/sync/sync0sync.c:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
storage/myisam/mi_open.c:
Auto merged
storage/myisammrg/ha_myisammrg.cc:
Auto merged
sql/ha_ndbcluster.cc:
merged
sql/item_cmpfunc.cc:
merged
sql/protocol.cc:
merged
sql/slave.cc:
merged
sql/sql_class.h:
merged
sql/sql_parse.cc:
merged
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 46890c5d6ea..c0178a231c9 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -234,6 +234,8 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) NET *net= &stmt->thd->net; uchar buff[12]; uint tmp; + int error; + THD *thd= stmt->thd; DBUG_ENTER("send_prep_stmt"); buff[0]= 0; /* OK packet indicator */ @@ -248,11 +250,16 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) Send types and names of placeholders to the client XXX: fix this nasty upcast from List<Item_param> to List<Item> */ - DBUG_RETURN(my_net_write(net, buff, sizeof(buff)) || - (stmt->param_count && - stmt->thd->protocol_text.send_fields((List<Item> *) - &stmt->lex->param_list, - Protocol::SEND_EOF))); + error= my_net_write(net, buff, sizeof(buff)); + if (stmt->param_count && ! error) + { + error= thd->protocol_text.send_fields((List<Item> *) + &stmt->lex->param_list, + Protocol::SEND_EOF); + } + /* Flag that a response has already been sent */ + thd->main_da.disable_status(); + DBUG_RETURN(error); } #else static bool send_prep_stmt(Prepared_statement *stmt, @@ -263,6 +270,7 @@ static bool send_prep_stmt(Prepared_statement *stmt, thd->client_stmt_id= stmt->id; thd->client_param_count= stmt->param_count; thd->clear_error(); + thd->main_da.disable_status(); return 0; } @@ -2516,6 +2524,8 @@ void mysql_stmt_close(THD *thd, char *packet) DBUG_ASSERT(! (stmt->flags & (uint) Prepared_statement::IS_IN_USE)); (void) stmt->deallocate(); + thd->main_da.disable_status(); + DBUG_VOID_RETURN; } @@ -2576,6 +2586,8 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) DBUG_ENTER("mysql_stmt_get_longdata"); status_var_increment(thd->status_var.com_stmt_send_long_data); + + thd->main_da.disable_status(); #ifndef EMBEDDED_LIBRARY /* Minimal size of long data packet is 6 bytes */ if (packet_length < MYSQL_LONG_DATA_HEADER) @@ -2650,11 +2662,7 @@ bool Select_fetch_protocol_binary::send_fields(List<Item> &list, uint flags) bool Select_fetch_protocol_binary::send_eof() { - Protocol *save_protocol= thd->protocol; - - thd->protocol= &protocol; ::send_eof(thd); - thd->protocol= save_protocol; return FALSE; } @@ -3076,7 +3084,6 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) thd->query_length) <= 0) { error= mysql_execute_command(thd); - query_cache_end_of_result(thd); } } |