Skip to content

Commit e967e81

Browse files
Alexey Botchkovnayuta-yanagisawa
authored andcommitted
MDEV-27233 Fixes to make SQL SERVICE working
1 parent 3905c12 commit e967e81

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sql/sql_prepare.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5630,6 +5630,7 @@ class Protocol_local : public Protocol_text
56305630
MEM_ROOT *alloc;
56315631
THD *new_thd;
56325632
Security_context empty_ctx;
5633+
ulonglong client_capabilities;
56335634

56345635
my_bool do_log_bin;
56355636

@@ -6257,6 +6258,7 @@ loc_advanced_command(MYSQL *mysql, enum enum_server_command command,
62576258
{
62586259
Ed_connection con(p->thd);
62596260
Security_context *ctx_orig= p->thd->security_ctx;
6261+
ulonglong cap_orig= p->thd->client_capabilities;
62606262
MYSQL_LEX_STRING sql_text;
62616263
my_bool log_bin_orig;
62626264
p->set_binlog_vars(&log_bin_orig);
@@ -6265,7 +6267,9 @@ loc_advanced_command(MYSQL *mysql, enum enum_server_command command,
62656267
sql_text.str= (char *) arg;
62666268
sql_text.length= arg_length;
62676269
p->thd->security_ctx= &p->empty_ctx;
6270+
p->thd->client_capabilities= p->client_capabilities;
62686271
result= con.execute_direct(p, sql_text);
6272+
p->thd->client_capabilities= cap_orig;
62696273
p->thd->security_ctx= ctx_orig;
62706274
p->restore_binlog_vars(log_bin_orig);
62716275
}
@@ -6391,6 +6395,7 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql)
63916395
THD *thd_orig= current_thd;
63926396
THD *new_thd;
63936397
Protocol_local *p;
6398+
ulonglong client_flag;
63946399
DBUG_ENTER("mysql_real_connect_local");
63956400

63966401
/* Test whether we're already connected */
@@ -6402,6 +6407,9 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql)
64026407

64036408
mysql->methods= &local_methods;
64046409
mysql->user= NULL;
6410+
client_flag= mysql->options.client_flag;
6411+
client_flag|= CLIENT_MULTI_RESULTS;;
6412+
client_flag&= ~(CLIENT_COMPRESS | CLIENT_PLUGIN_AUTH);
64056413

64066414
mysql->info_buffer= (char *) my_malloc(PSI_INSTRUMENT_ME,
64076415
MYSQL_ERRMSG_SIZE, MYF(0));
@@ -6425,6 +6433,7 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql)
64256433
new_thd->variables.wsrep_on= 0;
64266434
new_thd->variables.sql_log_bin= 0;
64276435
new_thd->set_binlog_bit();
6436+
new_thd->client_capabilities= client_flag;
64286437

64296438
/*
64306439
TOSO: decide if we should turn the auditing off
@@ -6446,6 +6455,7 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql)
64466455
{
64476456
p->empty_ctx.init();
64486457
p->empty_ctx.skip_grants();
6458+
p->client_capabilities= client_flag;
64496459
}
64506460

64516461
mysql->thd= p;

0 commit comments

Comments
 (0)