summaryrefslogtreecommitdiff
path: root/mysql-test/r/parser.result
diff options
context:
space:
mode:
authorNeeraj Bisht <neeraj.x.bisht@oracle.com>2014-02-12 14:33:56 +0530
committerNeeraj Bisht <neeraj.x.bisht@oracle.com>2014-02-12 14:33:56 +0530
commite13b28afdfe8cef236adc1d4b7d2e6ed9ae0872f (patch)
treecf3a270bb74235b92be8fd5825703b15cc3c0152 /mysql-test/r/parser.result
parentcebe93dc5b5a6af01e61b873f379b3ca6b86bb8f (diff)
downloadmariadb-git-e13b28afdfe8cef236adc1d4b7d2e6ed9ae0872f.tar.gz
Bug#17075846 - UNQUOTED FILE NAMES FOR VARIABLE VALUES ARE
ACCEPTED BUT PARSED INCORRECTLY When we are setting the value in a system variable, We can set it like set sys_var="Iden1.Iden2"; //1 set sys_var='Iden1.Iden2'; //2 set sys_var=Iden1.Iden2; //3 set sys_var=.ident1.ident2; //4 set sys_var=`Iden1.Iden2`; //5 While parsing, for case 1(when ANSI_QUOTES is enable) and 2, we will take as string literal(we will make item of type Item_string). for case 3 & 4, taken as Item_field, where Iden1 is a table name and iden2 is a field name. for case 5, again Item_field type, where iden1.iden2 is taken as field name. Now in case 1, when we are assigning some value to system variable (which can take string or enumerate type data), we are setting only field part. This means only iden2 value will be set for system variable. This result in wrong result. Solution: (for string type) We need to Document that we are not allowed to set system variable which takes string as identifier, otherwise result in unexpected behaviour. (for enumerate type) if we pass iden1.iden2, we will give an error ER_WRONG_TYPE_FOR_VAR (Incorrect argument type to variable). mysql-test/suite/sys_vars/t/general_log_file_basic.test: Earlier we used to give ER_WRONG_VALUE_FOR_VAR error, but in the patch of (Bug32748-Inconsistent handling of assignments to general_log_file/slow_query_log_file) they quoted this line.But i am not able to find any relation of this with the changes of patch. So i think We should give error in this case. mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test: Earlier we used to give ER_WRONG_VALUE_FOR_VAR error, but in the patch of (Bug32748-Inconsistent handling of assignments to general_log_file/slow_query_log_file) they quoted this line.But i am not able to find any relation of this with the changes of patch. So i think We should give error in this case.
Diffstat (limited to 'mysql-test/r/parser.result')
-rw-r--r--mysql-test/r/parser.result25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index 1ea9e91df8a..a96773b8d81 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -622,3 +622,28 @@ DROP TABLE t1, t2, t3;
#
# End of 5.1 tests
#
+#
+# Bug#17075846 : unquoted file names for variable values are
+# accepted but parsed incorrectly
+#
+SET default_storage_engine=a.myisam;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET default_storage_engine = .a.MyISAM;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET default_storage_engine = a.b.MyISAM;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET default_storage_engine = `a`.MyISAM;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET default_storage_engine = `a`.`MyISAM`;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+set default_storage_engine = "a.MYISAM";
+ERROR 42000: Unknown storage engine 'a.MYISAM'
+set default_storage_engine = 'a.MYISAM';
+ERROR 42000: Unknown storage engine 'a.MYISAM'
+set default_storage_engine = `a.MYISAM`;
+ERROR 42000: Unknown storage engine 'a.MYISAM'
+CREATE TABLE t1 (s VARCHAR(100));
+CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
+SET default_storage_engine = NEW.INNODB;
+ERROR 42S22: Unknown column 'INNODB' in 'NEW'
+DROP TABLE t1;