List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:May 9 2011 8:48am
Subject:bzr push into mysql-trunk branch (alexander.nozdrin:3384 to 3385)
View as plain text  
 3385 Alexander Nozdrin	2011-05-09 [merge]
      Manual merge from mysql-5.5.

    modified:
      mysql-test/r/trigger.result
      mysql-test/t/trigger.test
      sql/item.cc
 3384 Luis Soares	2011-05-06 [merge]
      BUG#12358775
      
      Automerging bzr bundle into latest mysql-trunk.

    added:
      mysql-test/include/start_slave_io.inc
      mysql-test/include/start_slave_sql.inc
    modified:
      mysql-test/suite/rpl/r/rpl_crash_safe_master.result
      mysql-test/suite/rpl/t/rpl_crash_safe_master.test
=== modified file 'mysql-test/r/trigger.result'
--- a/mysql-test/r/trigger.result	2011-03-10 08:33:54 +0000
+++ b/mysql-test/r/trigger.result	2011-05-09 08:48:22 +0000
@@ -2196,6 +2196,26 @@ trigger_name
 # Clean-up.
 drop temporary table t1;
 drop table t1;
+
+#
+# Bug #12362125: SP INOUT HANDLING IS BROKEN FOR TEXT TYPE.
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(c TEXT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE v TEXT;
+SET v = 'aaa';
+SET NEW.c = v;
+END|
+INSERT INTO t1 VALUES('qazwsxedc');
+SELECT c FROM t1;
+c
+aaa
+DROP TABLE t1;
+
+End of 5.5 tests.
+
 #
 # Bug#34432 Wrong lock type passed to the engine if pre-locking + 
 #           multi-update in a trigger

=== modified file 'mysql-test/t/trigger.test'
--- a/mysql-test/t/trigger.test	2011-03-10 08:33:54 +0000
+++ b/mysql-test/t/trigger.test	2011-05-09 08:48:22 +0000
@@ -2569,6 +2569,38 @@ select trigger_name from information_sch
 drop temporary table t1;
 drop table t1;
 
+
+--echo
+--echo #
+--echo # Bug #12362125: SP INOUT HANDLING IS BROKEN FOR TEXT TYPE.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(c TEXT);
+
+delimiter |;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+  DECLARE v TEXT;
+  SET v = 'aaa';
+  SET NEW.c = v;
+END|
+delimiter ;|
+
+INSERT INTO t1 VALUES('qazwsxedc');
+
+SELECT c FROM t1;
+
+DROP TABLE t1;
+
+--echo
+--echo End of 5.5 tests.
+--echo
+
+
 --echo #
 --echo # Bug#34432 Wrong lock type passed to the engine if pre-locking + 
 --echo #           multi-update in a trigger

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2011-05-06 13:32:53 +0000
+++ b/sql/item.cc	2011-05-09 08:48:22 +0000
@@ -7267,8 +7267,26 @@ bool Item_trigger_field::set_value(THD *
 {
   Item *item= sp_prepare_func_item(thd, it);
 
-  return (!item || (!fixed && fix_fields(thd, 0)) ||
-          (item->save_in_field(field, 0) < 0));
+  if (!item)
+    return true;
+
+  if (!fixed)
+  {
+    if (fix_fields(thd, NULL))
+      return true;
+  }
+
+  // NOTE: field->table->copy_blobs should be false here, but let's
+  // remember the value at runtime to avoid subtle bugs.
+  bool copy_blobs_saved= field->table->copy_blobs;
+
+  field->table->copy_blobs= true;
+
+  int err_code= item->save_in_field(field, 0);
+
+  field->table->copy_blobs= copy_blobs_saved;
+
+  return err_code < 0;
 }
 
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (alexander.nozdrin:3384 to 3385) Alexander Nozdrin9 May