List:Commits« Previous MessageNext Message »
From:ahristov Date:November 2 2006 1:59pm
Subject:bk commit into 5.1 tree (andrey:1.2338)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey 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-11-02 13:59:44+01:00, andrey@stripped +4 -0
  Merge ahristov@stripped:/home/bk/mysql-5.1-runtime
  into  example.com:/work/mysql-5.1-runtime-bug22830-new
  MERGE: 1.2303.12.1

  sql/sql_lex.cc@stripped, 2006-11-02 13:59:32+01:00, andrey@stripped +0 -0
    Auto merged
    MERGE: 1.203.1.1

  sql/sql_lex.h@stripped, 2006-11-02 13:59:32+01:00, andrey@stripped +0 -0
    Auto merged
    MERGE: 1.245.2.1

  sql/sql_parse.cc@stripped, 2006-11-02 13:59:33+01:00, andrey@stripped +0 -0
    Auto merged
    MERGE: 1.589.1.1

  sql/sql_yacc.yy@stripped, 2006-11-02 13:59:34+01:00, andrey@stripped +0 -0
    Auto merged
    MERGE: 1.510.1.1

# 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:	andrey
# Host:	example.com
# Root:	/work/mysql-5.1-runtime-bug22830-new/RESYNC

--- 1.205/sql/sql_lex.cc	2006-11-02 13:59:55 +01:00
+++ 1.206/sql/sql_lex.cc	2006-11-02 13:59:55 +01:00
@@ -2150,6 +2150,28 @@ void st_lex::restore_backup_query_tables
 
 
 /*
+  Checks for usage of routines and/or tables in a parsed statement
+
+  SYNOPSIS
+    st_lex:table_or_sp_used()
+
+  RETURN
+    FALSE  No routines and tables used
+    TRUE   Either or both routines and tables are used.
+*/
+
+bool st_lex::table_or_sp_used()
+{
+  DBUG_ENTER("table_or_sp_used");
+
+  if (sroutines.records || query_tables)
+    DBUG_RETURN(TRUE);
+
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
   Do end-of-prepare fixup for list of tables and their merge-VIEWed tables
 
   SYNOPSIS
@@ -2215,6 +2237,7 @@ void st_select_lex::fix_prepare_informat
     fix_prepare_info_in_table_list(thd, (TABLE_LIST *)table_list.first);
   }
 }
+
 
 /*
   There are st_select_lex::add_table_to_list &

--- 1.249/sql/sql_lex.h	2006-11-02 13:59:56 +01:00
+++ 1.250/sql/sql_lex.h	2006-11-02 13:59:56 +01:00
@@ -1203,6 +1203,8 @@ typedef struct st_lex : public Query_tab
 
   void reset_n_backup_query_tables_list(Query_tables_list *backup);
   void restore_backup_query_tables_list(Query_tables_list *backup);
+
+  bool table_or_sp_used();
 } LEX;
 
 struct st_lex_local: public st_lex

--- 1.590/sql/sql_parse.cc	2006-11-02 13:59:56 +01:00
+++ 1.591/sql/sql_parse.cc	2006-11-02 13:59:56 +01:00
@@ -3900,6 +3900,12 @@ end_with_restore_list:
   case SQLCOM_ALTER_EVENT:
   {
     DBUG_ASSERT(lex->event_parse_data);
+    if (lex->table_or_sp_used())
+    {
+      my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
+               "function calls as part of this statement");
+      break;
+    }
     switch (lex->sql_command) {
     case SQLCOM_CREATE_EVENT:
       res= Events::get_instance()->
@@ -4200,6 +4206,13 @@ end_with_restore_list:
   case SQLCOM_KILL:
   {
     Item *it= (Item *)lex->value_list.head();
+
+    if (lex->table_or_sp_used())
+    {
+      my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
+               "function calls as part of this statement");
+      break;
+    }
 
     if ((!it->fixed && it->fix_fields(lex->thd, &it)) ||
it->check_cols(1))
     {

--- 1.511/sql/sql_yacc.yy	2006-11-02 13:59:56 +01:00
+++ 1.512/sql/sql_yacc.yy	2006-11-02 13:59:56 +01:00
@@ -1329,7 +1329,6 @@ event_tail:
 
             Lex->sql_command= SQLCOM_CREATE_EVENT;
             /* We need that for disallowing subqueries */
-            Lex->expr_allows_subselect= FALSE;
           }
           ON SCHEDULE_SYM ev_schedule_time
           opt_ev_on_completion
@@ -1351,7 +1350,6 @@ event_tail:
               can overwrite it
             */
             Lex->sql_command= SQLCOM_CREATE_EVENT;
-            Lex->expr_allows_subselect= TRUE;
           }
       ;
 
@@ -4737,8 +4735,6 @@ alter:
             YYTHD->client_capabilities &= ~CLIENT_MULTI_QUERIES;
 
             Lex->sql_command= SQLCOM_ALTER_EVENT;
-            /* we need that for disallowing subqueries */
-            Lex->expr_allows_subselect= FALSE;
           }
           ev_alter_on_schedule_completion
           opt_ev_rename_to
@@ -4764,7 +4760,6 @@ alter:
               can overwrite it
             */
             Lex->sql_command= SQLCOM_ALTER_EVENT;
-            Lex->expr_allows_subselect= TRUE;
           }
         | ALTER TABLESPACE alter_tablespace_info
           {
@@ -8639,17 +8634,12 @@ purge_option:
 /* kill threads */
 
 kill:
-	KILL_SYM
-        {
-          Lex->sql_command= SQLCOM_KILL;
-          Lex->expr_allows_subselect= FALSE;
-        }
-        kill_option expr
+	KILL_SYM kill_option expr
 	{
 	  LEX *lex=Lex;
 	  lex->value_list.empty();
-	  lex->value_list.push_front($4);
-          Lex->expr_allows_subselect= TRUE;
+	  lex->value_list.push_front($3);
+          lex->sql_command= SQLCOM_KILL;
 	};
 
 kill_option:
Thread
bk commit into 5.1 tree (andrey:1.2338)ahristov2 Nov