MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:gluh Date:April 6 2005 9:13am
Subject:bk commit into 4.1 tree (gluh:1.2162) BUG#9286
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2162 05/04/06 14:13:06 gluh@stripped +4 -0
  Fix for bug #9286: SESSION/GLOBAL should be disallowed for user variables

  BitKeeper/etc/logging_ok
    1.376 05/04/06 14:13:05 gluh@stripped +1 -0
    Logging to logging@stripped accepted

  sql/sql_yacc.yy
    1.380 05/04/06 14:11:08 gluh@stripped +39 -27
    Fix for bug #9286: SESSION/GLOBAL should be disallowed for user variables

  mysql-test/t/user_var.test
    1.20 05/04/06 14:11:08 gluh@stripped +8 -0
    Fix for bug #9286: SESSION/GLOBAL should be disallowed for user variables

  mysql-test/r/user_var.result
    1.27 05/04/06 14:11:08 gluh@stripped +4 -0
    Fix for bug #9286: SESSION/GLOBAL should be disallowed for user variables

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Bugs/mysql-4.1.9286

--- 1.379/sql/sql_yacc.yy	Fri Feb 18 17:19:04 2005
+++ 1.380/sql/sql_yacc.yy	Wed Apr  6 14:11:08 2005
@@ -5360,17 +5360,26 @@
 	| OPTION {};
 
 option_value_list:
-	option_type option_value
-	| option_value_list ',' option_type option_value;
+        option_value_ext
+        | option_value_list ',' option_value_ext;
 
-option_type:
-	/* empty */	{}
+option_value_ext:
+        option_type_ext sys_option_value {}
+        | option_type option_value {}
+        ;
+
+option_type_ext:
+        option_type     {}
 	| GLOBAL_SYM	{ Lex->option_type= OPT_GLOBAL; }
 	| LOCAL_SYM	{ Lex->option_type= OPT_SESSION; }
 	| SESSION_SYM	{ Lex->option_type= OPT_SESSION; }
-	| ONE_SHOT_SYM	{ Lex->option_type= OPT_SESSION; Lex->one_shot_set= 1; }
 	;
 
+option_type:
+        /* empty */	{}
+        | ONE_SHOT_SYM	{ Lex->option_type= OPT_SESSION; Lex->one_shot_set= 1; }
+        ;
+
 opt_var_type:
 	/* empty */	{ $$=OPT_SESSION; }
 	| GLOBAL_SYM	{ $$=OPT_GLOBAL; }
@@ -5385,34 +5394,37 @@
 	| SESSION_SYM '.'	{ $$=OPT_SESSION; }
 	;
 
+sys_option_value:
+        internal_variable_name equal set_expr_or_default
+        {
+          LEX *lex=Lex;
+          lex->var_list.push_back(new set_var(lex->option_type, $1.var,
+                                  &$1.base_name, $3));
+        }
+        | TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
+        {
+          LEX *lex=Lex;
+          LEX_STRING tmp;
+          tmp.str=0;
+          tmp.length=0;
+          lex->var_list.push_back(new set_var(lex->option_type,
+                                              find_sys_var("tx_isolation"),
+                                              &tmp,
+                                              new Item_int((int32) $4)));
+        }
+        ;
+
 option_value:
 	'@' ident_or_text equal expr
 	{
 	  Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
 	}
-	| internal_variable_name equal set_expr_or_default
-	  {
-	    LEX *lex=Lex;
-	    lex->var_list.push_back(new set_var(lex->option_type, $1.var,
-						&$1.base_name, $3));
-	  }
 	| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
-	  {
-	    LEX *lex=Lex;
-	    lex->var_list.push_back(new set_var((enum_var_type) $3, $4.var,
-						&$4.base_name, $6));
-	  }
-	| TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
-	  {
-	    LEX *lex=Lex;
-	    LEX_STRING tmp;
-	    tmp.str=0;
-	    tmp.length=0;
-	    lex->var_list.push_back(new set_var(lex->option_type,
-						find_sys_var("tx_isolation"),
-						&tmp,
-						new Item_int((int32) $4)));
-	  }
+	{
+          LEX *lex=Lex;
+          lex->var_list.push_back(new set_var((enum_var_type) $3, $4.var,
+                                  &$4.base_name, $6));
+        }
 	| charset old_or_new_charset_name_or_default
 	{
 	  THD *thd= YYTHD;

--- 1.375/BitKeeper/etc/logging_ok	Fri Apr  1 15:34:09 2005
+++ 1.376/BitKeeper/etc/logging_ok	Wed Apr  6 14:13:05 2005
@@ -51,6 +51,7 @@
 gerberb@stripped
 gluh@gluh.(none)
 gluh@stripped
+gluh@stripped
 gordon@stripped
 greg@stripped
 greg@stripped

--- 1.26/mysql-test/r/user_var.result	Sat Apr  2 05:41:49 2005
+++ 1.27/mysql-test/r/user_var.result	Wed Apr  6 14:11:08 2005
@@ -175,3 +175,7 @@
 select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
 coercibility(@v1)	coercibility(@v2)	coercibility(@v3)	coercibility(@v4)
 2	2	2	2
+set session @honk=99;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1
+set one_shot @honk=99;
+ERROR HY000: The SET ONE_SHOT syntax is reserved for purposes internal to the MySQL server

--- 1.19/mysql-test/t/user_var.test	Sat Apr  2 05:41:50 2005
+++ 1.20/mysql-test/t/user_var.test	Wed Apr  6 14:11:08 2005
@@ -111,3 +111,11 @@
 select @v, coercibility(@v);
 set @v1=null, @v2=1, @v3=1.1, @v4=now();
 select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
+
+#
+# Bug #9286  SESSION/GLOBAL should be disallowed for user variables
+#
+--error 1064
+set session @honk=99;
+--error 1105
+set one_shot @honk=99;
Thread
bk commit into 4.1 tree (gluh:1.2162) BUG#9286gluh6 Apr