diff options
author | unknown <cmiller@maint1.mysql.com> | 2006-08-15 18:41:21 +0200 |
---|---|---|
committer | unknown <cmiller@maint1.mysql.com> | 2006-08-15 18:41:21 +0200 |
commit | e0bffad3e8c121d81e1e64682d7fc8bc5aad8fcf (patch) | |
tree | 3c68981f31652387f476c382903a11ee5922f955 /mysql-test/r/variables.result | |
parent | 75e40b161b5cbbea28eca2641e6dfadaf09267a1 (diff) | |
download | mariadb-git-e0bffad3e8c121d81e1e64682d7fc8bc5aad8fcf.tar.gz |
Bug #20908: Crash if select @@""
Zero-length variables caused failures when using the length to look
up the name in a hash. Instead, signal that no zero-length name can
ever be found and that to encounter one is a syntax error.
mysql-test/r/variables.result:
Results for test.
mysql-test/t/variables.test:
Insert tests to prove that zero-length variable names do not cause
faults.
sql/gen_lex_hash.cc:
If the length is zero, then there is nothing to look-up in the
hash.
sql/sql_lex.cc:
Names of variables must not be empty. Signal an error of that
happens.
Diffstat (limited to 'mysql-test/r/variables.result')
-rw-r--r-- | mysql-test/r/variables.result | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index a0e516d2397..cd834a789bd 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -689,6 +689,12 @@ select @@log_queries_not_using_indexes; show variables like 'log_queries_not_using_indexes'; Variable_name Value log_queries_not_using_indexes OFF +select @@""; +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 '""' at line 1 +select @@&; +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 '&' at line 1 +select @@@; +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 '@' at line 1 End of 5.0 tests set global binlog_cache_size =@my_binlog_cache_size; set global connect_timeout =@my_connect_timeout; |