summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-03-28 22:18:38 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-03-28 22:18:38 +0300
commit2bd4dc38e0d5eb257e2e29413dd01239ce075d42 (patch)
treedad0557b1d927d012aebd1c36c8c3e00462adcb1 /libmysqld
parent44fdb56c977259b2801c612116813beda403df78 (diff)
parent3df261dc31ab18ee1537f327b07320b0a07fb8f5 (diff)
downloadmariadb-git-2bd4dc38e0d5eb257e2e29413dd01239ce075d42.tar.gz
Merge branch '10.2' into bb-10.2-mdev9543
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/CMakeLists.txt1
-rw-r--r--libmysqld/lib_sql.cc7
2 files changed, 5 insertions, 3 deletions
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 2bdbc41a347..ad16584ec0e 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -110,6 +110,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/item_inetfunc.cc
../sql/wsrep_dummy.cc ../sql/encryption.cc
../sql/item_windowfunc.cc ../sql/sql_window.cc
+ ../sql/sql_cte.cc
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
)
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 5035064b8e0..476981023fd 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -165,7 +165,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
arg_length= header_length;
}
- result= dispatch_command(command, thd, (char *) arg, arg_length);
+ result= dispatch_command(command, thd, (char *) arg, arg_length, FALSE,
+ FALSE);
thd->cur_data= 0;
thd->mysys_var= NULL;
@@ -428,8 +429,8 @@ static void emb_free_embedded_thd(MYSQL *mysql)
thread_count--;
thd->store_globals();
thd->unlink();
- delete thd;
mysql_mutex_unlock(&LOCK_thread_count);
+ delete thd;
my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0;
}
@@ -664,7 +665,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
void *create_embedded_thd(int client_flag)
{
THD * thd= new THD;
- thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
+ thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id();
thd->thread_stack= (char*) &thd;
if (thd->store_globals())