MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:ramil Date:November 26 2007 9:29am
Subject:bk commit into 5.0 tree (ramil:1.2579) BUG#32676
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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, 2007-11-26 13:29:26+04:00, ramil@stripped +3 -0
  Fix for bug #32676: insert delayed crash with wrong column and function specified
  
  Problem: using wrong local lock type value in the mysql_insert() results in a crash. 
  
  Fix: use a proper value.

  mysql-test/r/delayed.result@stripped, 2007-11-26 13:29:25+04:00, ramil@stripped +5 -0
    Fix for bug #32676: insert delayed crash with wrong column and function specified
      - test result.

  mysql-test/t/delayed.test@stripped, 2007-11-26 13:29:25+04:00, ramil@stripped +9 -0
    Fix for bug #32676: insert delayed crash with wrong column and function specified
      - test case.

  sql/sql_insert.cc@stripped, 2007-11-26 13:29:25+04:00, ramil@stripped +2 -2
    Fix for bug #32676: insert delayed crash with wrong column and function specified
      - the local lock_type var assigment displaced just after the line 
        where the table_list->lock_type is filnally defined in the mysql_insert() 
        to avoid using its old value.

diff -Nrup a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
--- a/mysql-test/r/delayed.result	2007-03-20 17:53:54 +04:00
+++ b/mysql-test/r/delayed.result	2007-11-26 13:29:25 +04:00
@@ -255,3 +255,8 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNI
 INSERT DELAYED INTO t2 VALUES(1);
 ERROR HY000: Table storage engine for 't2' doesn't have this option
 DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT);
+INSERT DELAYED INTO t1 SET b= b();
+ERROR 42S22: Unknown column 'b' in 'field list'
+DROP TABLE t1;
+End of 5.0 tests
diff -Nrup a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
--- a/mysql-test/t/delayed.test	2007-03-20 17:53:54 +04:00
+++ b/mysql-test/t/delayed.test	2007-11-26 13:29:25 +04:00
@@ -252,3 +252,12 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNI
 INSERT DELAYED INTO t2 VALUES(1);
 DROP TABLE t1, t2;
 
+#
+# Bug #32676: insert delayed crash with wrong column and function specified
+#
+CREATE TABLE t1 (a INT);
+--error  ER_BAD_FIELD_ERROR
+INSERT DELAYED INTO t1 SET b= b();
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff -Nrup a/sql/sql_insert.cc b/sql/sql_insert.cc
--- a/sql/sql_insert.cc	2007-09-27 14:17:13 +05:00
+++ b/sql/sql_insert.cc	2007-11-26 13:29:25 +04:00
@@ -585,7 +585,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
   bool log_on= (thd->options & OPTION_BIN_LOG) ||
     (!(thd->security_ctx->master_access & SUPER_ACL));
 #endif
-  thr_lock_type lock_type = table_list->lock_type;
+  thr_lock_type lock_type;
   Item *unused_conds= 0;
   DBUG_ENTER("mysql_insert");
 
@@ -620,6 +620,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
     if (open_and_lock_tables(thd, table_list))
       DBUG_RETURN(TRUE);
   }
+  lock_type= table_list->lock_type;
 
   thd->proc_info="init";
   thd->used_tables=0;
@@ -637,7 +638,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
 
   /* mysql_prepare_insert set table_list->table if it was not set */
   table= table_list->table;
-  lock_type= table_list->lock_type;
 
   context= &thd->lex->select_lex.context;
   /*
Thread
bk commit into 5.0 tree (ramil:1.2579) BUG#32676ramil26 Nov