From 7045ec27a6d560752717a0db0e4fb6eba5dc0be9 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 28 Jan 2022 13:53:39 +0200 Subject: Fixed wrong function call in embedded server This happens when compiled with HAVE_EMBEDDED_PRIVILEGE_CONTROL. There is a lot of other problems with the above option that should be fixed at some point --- libmysqld/lib_sql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmysqld/lib_sql.cc') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index ddb3f2c71aa..a0c57239dec 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -831,7 +831,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db) /* acl_authenticate() takes the data from thd->net->read_pos */ thd->net.read_pos= (uchar*)buf; - if (acl_authenticate(thd, 0, end - buf)) + if (acl_authenticate(thd, (uint) (end - buf))) { my_free(thd->security_ctx->user); goto err; -- cgit v1.2.1 From 9667ec1f53df5a7a439926d9e45819ab769326b6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 30 Jan 2022 13:56:22 +0100 Subject: fix query cache in embedded this fixes main.partition_cache and main.cache_innodb in --embed followup for 430d60d1fc0 MDEV-24487 --- libmysqld/lib_sql.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmysqld/lib_sql.cc') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index c6493773db0..d92265508b4 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -660,7 +660,7 @@ void end_embedded_server() } -void init_embedded_mysql(MYSQL *mysql, int client_flag) +void init_embedded_mysql(MYSQL *mysql, ulong client_flag) { THD *thd = (THD *)mysql->thd; thd->mysql= mysql; @@ -680,7 +680,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag) create_new_thread(), and prepare_new_connection_state(). This should be refactored to avoid code duplication. */ -void *create_embedded_thd(int client_flag) +void *create_embedded_thd(ulong client_flag) { THD * thd= new THD(next_thread_id()); -- cgit v1.2.1 From 66bc8bf09e7cb8f00ac5d963bd988eff74d5af59 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 30 Jan 2022 18:09:55 +0100 Subject: fix query cache in embedded, enable MARIADB_CLIENT_EXTENDED_METADATA this fixes plugins.qc_info in --embed followup for 430d60d1fc0 MDEV-24487 --- libmysqld/lib_sql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmysqld/lib_sql.cc') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index d92265508b4..af05535c14f 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -696,7 +696,7 @@ void *create_embedded_thd(ulong client_flag) thd->set_command(COM_SLEEP); thd->set_time(); thd->init_for_queries(); - thd->client_capabilities= client_flag; + thd->client_capabilities= client_flag | MARIADB_CLIENT_EXTENDED_METADATA; thd->real_id= pthread_self(); thd->db= null_clex_str; -- cgit v1.2.1