List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:August 15 2006 12:34am
Subject:bk commit into 5.0 tree (cmiller:1.2228) BUG#20908
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller 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@stripped, 2006-08-15 00:33:51+02:00, cmiller@stripped +3 -0
  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.

  mysql-test/r/variables.result@stripped, 2006-08-15 00:29:15+02:00, cmiller@stripped
+6 -0
    Results for test.

  mysql-test/t/variables.test@stripped, 2006-08-15 00:29:15+02:00, cmiller@stripped
+11 -0
    Insert tests to prove that zero-length variable names do not cause
    faults.

  sql/gen_lex_hash.cc@stripped, 2006-08-15 00:29:16+02:00, cmiller@stripped +4 -0
    If the length is zero, then there is nothing to look-up in the 
    hash.

# 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:	cmiller
# Host:	maint1.mysql.com
# Root:	/data/localhome/cmiller/bug20908/my50-bug20908

--- 1.66/sql/gen_lex_hash.cc	2006-08-15 00:34:16 +02:00
+++ 1.67/sql/gen_lex_hash.cc	2006-08-15 00:34:16 +02:00
@@ -468,6 +468,10 @@ static inline SYMBOL *get_hash_symbol(co
 {\n\
   register uchar *hash_map;\n\
   register const char *cur_str= s;\n\
+\n\
+  if (len == 0)\n\
+    return(NULL);\n\
+\n\
   if (function){\n\
     if (len>sql_functions_max_len) return 0;\n\
     hash_map= sql_functions_map;\n\

--- 1.87/mysql-test/r/variables.result	2006-08-15 00:34:16 +02:00
+++ 1.88/mysql-test/r/variables.result	2006-08-15 00:34:16 +02:00
@@ -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 HY000: Unknown system variable ''
+select @@&;
+ERROR HY000: Unknown system variable ''
+select @@@;
+ERROR HY000: Unknown system variable ''
 End of 5.0 tests
 set global binlog_cache_size         =@my_binlog_cache_size;
 set global connect_timeout           =@my_connect_timeout;

--- 1.62/mysql-test/t/variables.test	2006-08-15 00:34:16 +02:00
+++ 1.63/mysql-test/t/variables.test	2006-08-15 00:34:16 +02:00
@@ -585,6 +585,16 @@ show variables like 'ssl%';
 select @@log_queries_not_using_indexes;
 show variables like 'log_queries_not_using_indexes';
 
+#
+# Bug#20908: Crash if select @@""
+#
+--error 1193
+select @@"";
+--error 1193
+select @@&;
+--error 1193
+select @@@;
+
 --echo End of 5.0 tests
 
 # This is at the very after the versioned tests, since it involves doing
@@ -620,3 +630,4 @@ set global server_id                 =@m
 set global slow_launch_time          =@my_slow_launch_time;
 set global storage_engine            =@my_storage_engine;
 set global thread_cache_size         =@my_thread_cache_size;
+
Thread
bk commit into 5.0 tree (cmiller:1.2228) BUG#20908Chad MILLER15 Aug