diff options
author | Georgi Kodinov <kgeorge@mysql.com> | 2008-10-10 16:07:53 +0300 |
---|---|---|
committer | Georgi Kodinov <kgeorge@mysql.com> | 2008-10-10 16:07:53 +0300 |
commit | b6704027d681a80be03d416e9c9c344d86a562dd (patch) | |
tree | 5f6db4fa32962714db3f7268e8a18472a0a218be /libmysqld | |
parent | 89d2b8efb9a45145b44b56aa5bdd2b341b46b382 (diff) | |
parent | 639ef9fa4c860c2ed111692341383f01c5ccdbcc (diff) | |
download | mariadb-git-b6704027d681a80be03d416e9c9c344d86a562dd.tar.gz |
merged 5.1-bugteam -> bug 34773 tree
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 2 | ||||
-rw-r--r-- | libmysqld/emb_qcache.cc | 3 | ||||
-rw-r--r-- | libmysqld/lib_sql.cc | 12 |
4 files changed, 16 insertions, 4 deletions
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 97c718627d1..1582f0898d8 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -185,8 +185,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/partition_info.cc ../sql/sql_connect.cc - ../sql/scheduler.cc ../sql/stacktrace.c - ../sql/event_parse_data.cc + ../sql/scheduler.cc ../sql/event_parse_data.cc ${GEN_SOURCES} ${LIB_SOURCES}) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 504980cbd07..ef2fab2da6d 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -69,7 +69,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sql_select.cc sql_do.cc sql_show.cc set_var.cc \ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \ - unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ + unireg.cc uniques.cc sql_union.cc hash_filo.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index fdd7f8ed776..b4eddf39c1f 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -447,7 +447,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src) if (thd->protocol == &thd->protocol_binary) { uint length; - row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS)); + row= (MYSQL_ROWS *)alloc_root(&data->alloc, + (size_t) (rows * sizeof(MYSQL_ROWS))); end_row= row + rows; data->data= row; diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 591b76f61ad..6e82812239e 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -79,6 +79,15 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, my_bool result= 1; THD *thd=(THD *) mysql->thd; NET *net= &mysql->net; + my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE; + + if (!thd) + { + /* Do "reconnect" if possible */ + if (mysql_reconnect(mysql) || stmt_skip) + return 1; + thd= (THD *) mysql->thd; + } #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) thd->profiling.start_new_query(); @@ -1094,6 +1103,9 @@ void Protocol_text::prepare_for_resend() data->embedded_info->prev_ptr= &cur->next; next_field=cur->data; next_mysql_field= data->embedded_info->fields_list; +#ifndef DBUG_OFF + field_pos= 0; +#endif DBUG_VOID_RETURN; } |