List:Commits« Previous MessageNext Message »
From:eugene Date:December 22 2005 11:01am
Subject:bk commit into 5.0 tree (evgen:1.1984) BUG#15538
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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.1984 05/12/22 14:01:49 evgen@stripped +3 -0
  Fix bug#15538 unchecked table absense caused server crash.
  
  Absense of table in left part of LEFT/RIGHT join wasn't checked before
  namespace processing. Which leads to NULL dereferencing and server crash.
  
  Modified rules: 
  "table_ref LEFT opt_outer JOIN_SYM table_ref" and "table_ref RIGHT opt_outer 
  JOIN_SYM table_ref"
  NULL check moved just before any rule handling is performed.

  mysql-test/t/select.test
    1.95 05/12/22 14:00:20 evgen@stripped +6 -0
    Test case for bug#15538 unchecked table absense caused server crash.

  mysql-test/r/select.result
    1.116 05/12/22 13:59:47 evgen@stripped +2 -0
    Test case for bug#15538 unchecked table absense caused server crash.

  sql/sql_yacc.yy
    1.446 05/12/22 13:59:38 evgen@stripped +2 -2
    Fix bug#15538 unchecked table absense caused server crash.
    Modified rules: 
    "table_ref LEFT opt_outer JOIN_SYM table_ref" and "table_ref RIGHT opt_outer 
    JOIN_SYM table_ref"
    NULL check moved just before any rule handling is performed.

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/15538-bug-5.0-mysql

--- 1.445/sql/sql_yacc.yy	2005-12-11 10:30:53 +03:00
+++ 1.446/sql/sql_yacc.yy	2005-12-22 13:59:38 +03:00
@@ -5248,13 +5248,13 @@
 	| table_ref LEFT opt_outer JOIN_SYM table_ref
           ON
           {
+            YYERROR_UNLESS($1 && $5);
             /* Change the current name resolution context to a local context. */
             if (push_new_name_resolution_context(YYTHD, $1, $5))
               YYABORT;
           }
           expr
 	  {
-            YYERROR_UNLESS($1 && $5);
             add_join_on($5,$8);
             Lex->pop_context();
             $5->outer_join|=JOIN_TYPE_LEFT;
@@ -5279,6 +5279,7 @@
 	| table_ref RIGHT opt_outer JOIN_SYM table_ref
           ON
           {
+            YYERROR_UNLESS($1 && $5);
             /* Change the current name resolution context to a local context. */
             if (push_new_name_resolution_context(YYTHD, $1, $5))
               YYABORT;
@@ -5286,7 +5287,6 @@
           expr
           {
 	    LEX *lex= Lex;
-            YYERROR_UNLESS($1 && $5);
             if (!($$= lex->current_select->convert_right_join()))
               YYABORT;
             add_join_on($$, $8);

--- 1.115/mysql-test/r/select.result	2005-12-09 23:01:41 +03:00
+++ 1.116/mysql-test/r/select.result	2005-12-22 13:59:47 +03:00
@@ -3345,3 +3345,5 @@
 f1	f2	f2
 NULL	a	NULL
 drop table t1,t2;
+select * from (select * left join t on f1=f2) tt;
+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 'on f1=f2) tt' at line 1

--- 1.94/mysql-test/t/select.test	2005-12-09 23:01:28 +03:00
+++ 1.95/mysql-test/t/select.test	2005-12-22 14:00:20 +03:00
@@ -2815,3 +2815,9 @@
 insert into t2 values('b');
 select * from t1 left join t2 on f1=t2.f2 where t1.f2='a';
 drop table t1,t2;
+
+#
+# Bug#15538 unchecked table absense caused server crash.
+#
+--error 1064
+select * from (select * left join t on f1=f2) tt;
Thread
bk commit into 5.0 tree (evgen:1.1984) BUG#15538eugene22 Dec