summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoranozdrin/alik@station. <>2007-10-10 17:57:01 +0400
committeranozdrin/alik@station. <>2007-10-10 17:57:01 +0400
commitac83b3122c32e84c2ec526760273d3a9b1176b49 (patch)
treea626f7589fb237fa37963de0acccf1ec7d936efd /sql
parentc6c419f91974676fd453d8a412a14e41f886671e (diff)
downloadmariadb-git-ac83b3122c32e84c2ec526760273d3a9b1176b49.tar.gz
Fix for BUG#20023: mysql_change_user() resets the value
of SQL_BIG_SELECTS. The bug was that SQL_BIG_SELECTS was not properly set in COM_CHANGE_USER. The fix is to update SQL_BIG_SELECTS properly.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysql_priv.h1
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_connect.cc4
3 files changed, 8 insertions, 3 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 6a7e3e00f6f..79d4c16f9c1 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -917,7 +917,6 @@ void decrease_user_connections(USER_CONN *uc);
void thd_init_client_charset(THD *thd, uint cs_number);
bool setup_connection_thread_globals(THD *thd);
bool login_connection(THD *thd);
-void prepare_new_connection_state(THD* thd);
void end_connection(THD *thd);
bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 66a51d5bb00..490aedad0ef 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -585,6 +585,12 @@ void THD::init(void)
if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
options= thd_startup_options;
+
+ if (variables.max_join_size == HA_POS_ERROR)
+ options |= OPTION_BIG_SELECTS;
+ else
+ options &= ~OPTION_BIG_SELECTS;
+
transaction.all.modified_non_trans_table= transaction.stmt.modified_non_trans_table= FALSE;
open_options=ha_open_options;
update_lock_default= (variables.low_priority_updates ?
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 9785b30ea00..094bef9324e 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -933,7 +933,7 @@ bool login_connection(THD *thd)
NET *net= &thd->net;
Security_context *sctx= thd->security_ctx;
DBUG_ENTER("login_connection");
- DBUG_PRINT("info", ("handle_one_connection called by thread %lu",
+ DBUG_PRINT("info", ("login_connection called by thread %lu",
thd->thread_id));
net->no_send_error= 0;
@@ -1003,7 +1003,7 @@ void end_connection(THD *thd)
Initialize THD to handle queries
*/
-void prepare_new_connection_state(THD* thd)
+static void prepare_new_connection_state(THD* thd)
{
Security_context *sctx= thd->security_ctx;