diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2022-01-18 12:14:25 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2022-01-18 12:14:25 +0400 |
commit | 9620aacf0e8ff99b656e551fee3905f8bd5017f6 (patch) | |
tree | bdaac65e0d389f493015d439c51d353fe0bc7003 | |
parent | 05b17c3dd0652e1732607c0ef67d2f72a8670ae2 (diff) | |
download | mariadb-git-9620aacf0e8ff99b656e551fee3905f8bd5017f6.tar.gz |
Fixes to make SQL SERVICE working.
-rw-r--r-- | sql/sql_prepare.cc | 10 | ||||
-rw-r--r-- | storage/spider/spd_table.cc | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 3d2c0e76ab3..ff3cd01c1a2 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -5348,6 +5348,7 @@ public: MEM_ROOT *alloc; THD *new_thd; Security_context empty_ctx; + ulonglong client_capabilities; Protocol_local(THD *thd_arg, THD *new_thd_arg, ulong prealloc) : Protocol_text(thd_arg, prealloc), @@ -5969,12 +5970,15 @@ loc_advanced_command(MYSQL *mysql, enum enum_server_command command, { Ed_connection con(p->thd); Security_context *ctx_orig= p->thd->security_ctx; + ulonglong cap_orig= p->thd->client_capabilities; MYSQL_LEX_STRING sql_text; DBUG_ASSERT(current_thd == p->thd); sql_text.str= (char *) arg; sql_text.length= arg_length; p->thd->security_ctx= &p->empty_ctx; + p->thd->client_capabilities= p->client_capabilities; result= con.execute_direct(p, sql_text); + p->thd->client_capabilities= cap_orig; p->thd->security_ctx= ctx_orig; } if (skip_check) @@ -6099,6 +6103,7 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql) THD *thd_orig= current_thd; THD *new_thd; Protocol_local *p; + ulonglong client_flag; DBUG_ENTER("mysql_real_connect_local"); /* Test whether we're already connected */ @@ -6110,6 +6115,9 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql) mysql->methods= &local_methods; mysql->user= NULL; + client_flag= mysql->options.client_flag; + client_flag|= CLIENT_MULTI_RESULTS;; + client_flag&= ~(CLIENT_COMPRESS | CLIENT_PLUGIN_AUTH); mysql->info_buffer= (char *) my_malloc(MYSQL_ERRMSG_SIZE, MYF(0)); if (!thd_orig || thd_orig->lock) @@ -6130,6 +6138,7 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql) new_thd->security_ctx->skip_grants(); new_thd->query_cache_is_applicable= 0; new_thd->variables.wsrep_on= 0; + new_thd->client_capabilities= client_flag; /* TOSO: decide if we should turn the auditing off for such threads. @@ -6150,6 +6159,7 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql) { p->empty_ctx.init(); p->empty_ctx.skip_grants(); + p->client_capabilities= client_flag; } mysql->thd= p; diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index f90392b75d3..653162fcfa6 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -7302,12 +7302,20 @@ int spider_db_init( uint i = 0; while (spider_init_queries[i].length) { + MYSQL_RES *res; + if (mysql_real_query(mysql, spider_init_queries[i].str, spider_init_queries[i].length)) { + mysql_close(mysql); goto error_init_udf_table_mon_list_hash; } + + if ((res= mysql_store_result(mysql))) + mysql_free_result(res); + ++i; } + mysql_close(mysql); } #ifndef WITHOUT_SPIDER_BG_SEARCH |