[Commits] 6a98efc: c

sanja at mariadb.com sanja at mariadb.com
Wed Feb 25 22:29:17 EET 2015


revision-id: 6a98efc7a9926e4843cb47caa51cd5409e4434e7
parent(s): da181fee4ec849985b15a758c6b26058a0f5e318
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-02-25 21:29:13 +0100
message:

c

---
 mysql-test/r/set_statement_notembedded.result | 4 ----
 mysql-test/t/set_statement_notembedded.test   | 4 ----
 sql/sql_parse.cc                              | 3 +++
 sql/sql_yacc.yy                               | 4 +++-
 sql/sys_vars.cc                               | 2 +-
 5 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/mysql-test/r/set_statement_notembedded.result b/mysql-test/r/set_statement_notembedded.result
index e45ae36..561c30d 100644
--- a/mysql-test/r/set_statement_notembedded.result
+++ b/mysql-test/r/set_statement_notembedded.result
@@ -16,7 +16,3 @@ Max_statement_time_exceeded	1
 SELECT @@MAX_STATEMENT_TIME;
 @@MAX_STATEMENT_TIME
 0.000000
-set statement default_master_connection=default for select 1;
-ERROR 42000: The system variable default_master_connection cannot be set in SET STATEMENT.
-set statement default_master_connection=default for select 1;
-ERROR 42000: The system variable default_master_connection cannot be set in SET STATEMENT.
diff --git a/mysql-test/t/set_statement_notembedded.test b/mysql-test/t/set_statement_notembedded.test
index b0021de..7bb8f5e 100644
--- a/mysql-test/t/set_statement_notembedded.test
+++ b/mysql-test/t/set_statement_notembedded.test
@@ -10,8 +10,4 @@ SET STATEMENT MAX_STATEMENT_TIME=2 FOR SELECT SLEEP(3);
 SHOW STATUS LIKE "max_statement_time_exceeded";
 SELECT @@MAX_STATEMENT_TIME;
 
---error ER_SET_STATEMENT_NOT_SUPPORTED
-set statement default_master_connection=default for select 1;
---error ER_SET_STATEMENT_NOT_SUPPORTED
-set statement default_master_connection=default for select 1;
 
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 64e016f..bf79f30 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2726,6 +2726,9 @@ static bool do_execute_sp(THD *thd, sp_head *sp)
     }
   }
 
+  if (thd->lex->mi.connection_name.str == NullS)
+      thd->lex->mi.connection_name= thd->variables.default_master_connection;
+
   /*
     Force statement logging for DDL commands to allow us to update
     privilege, system or statistic tables directly without the updates
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 8025340..8255306 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2445,7 +2445,9 @@ optional_connection_name:
           /* empty */
           {
             LEX *lex= thd->lex;
-            lex->mi.connection_name= thd->variables.default_master_connection;
+            lex->mi.connection_name.str= NullS;
+            lex->mi.connection_name.length= 0;
+              //thd->variables.default_master_connection;
           }
         | connection_name;
         ;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 0dea5a1..74e0c6b 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -993,7 +993,7 @@ static bool check_master_connection(sys_var *self, THD *thd, set_var *var)
 static Sys_var_session_lexstring Sys_default_master_connection(
        "default_master_connection",
        "Master connection to use for all slave variables and slave commands",
-       NO_SET_STMT SESSION_ONLY(default_master_connection),
+       SESSION_ONLY(default_master_connection),
        NO_CMD_LINE, IN_SYSTEM_CHARSET,
        DEFAULT(""), MAX_CONNECTION_NAME, ON_CHECK(check_master_connection));
 #endif


More information about the commits mailing list