List:Commits« Previous MessageNext Message »
From:Martin Skold Date:January 31 2007 10:38pm
Subject:bk commit into 5.0 tree (mskold:1.2295) BUG#25522
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marty. When marty 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-01-31 22:38:06+01:00, mskold@stripped +3 -0
  Bug #25522  Update with IN syntax Clustertable + Trigger leads to mysqld segfault: in
start_stmt, only change query_state if starting a new transactions, in
read_multi_range_next, change query state when end is reached

  mysql-test/r/ndb_read_multi_range.result@stripped, 2007-01-31 22:36:49+01:00,
mskold@stripped +17 -0
    Bug #25522  Update with IN syntax Clustertable + Trigger leads to mysqld segfault: in
start_stmt, only change query_state if starting a new transactions, in
read_multi_range_next, change query state when end is reached

  mysql-test/t/ndb_read_multi_range.test@stripped, 2007-01-31 22:36:49+01:00, mskold@stripped
+29 -0
    Bug #25522  Update with IN syntax Clustertable + Trigger leads to mysqld segfault: in
start_stmt, only change query_state if starting a new transactions, in
read_multi_range_next, change query state when end is reached

  sql/ha_ndbcluster.cc@stripped, 2007-01-31 22:36:48+01:00, mskold@stripped +6 -2
    Bug #25522  Update with IN syntax Clustertable + Trigger leads to mysqld segfault: in
start_stmt, only change query_state if starting a new transactions, in
read_multi_range_next, change query state when end is reached

# 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:	mskold
# Host:	linux.site
# Root:	/windows/Linux_space/MySQL/mysql-5.0

--- 1.291/sql/ha_ndbcluster.cc	2007-01-31 22:38:18 +01:00
+++ 1.292/sql/ha_ndbcluster.cc	2007-01-31 22:38:18 +01:00
@@ -3877,10 +3877,10 @@ int ha_ndbcluster::start_stmt(THD *thd, 
       ERR_RETURN(ndb->getNdbError());
     no_uncommitted_rows_reset(thd);
     thd_ndb->stmt= trans;
+    thd_ndb->query_state&= NDB_QUERY_NORMAL;
+    m_active_trans= trans;
     trans_register_ha(thd, FALSE, &ndbcluster_hton);
   }
-  thd_ndb->query_state&= NDB_QUERY_NORMAL;
-  m_active_trans= trans;
 
   // Start of statement
   m_retrieve_all_fields= FALSE;
@@ -6512,7 +6512,11 @@ close_scan:
   }
   
   if (multi_range_curr == multi_range_end)
+  {
+    Thd_ndb *thd_ndb= get_thd_ndb(current_thd);
+    thd_ndb->query_state&= NDB_QUERY_NORMAL;
     DBUG_RETURN(HA_ERR_END_OF_FILE);
+  }
   
   /**
    * Read remaining ranges

--- 1.6/mysql-test/r/ndb_read_multi_range.result	2007-01-31 22:38:18 +01:00
+++ 1.7/mysql-test/r/ndb_read_multi_range.result	2007-01-31 22:38:18 +01:00
@@ -381,3 +381,20 @@ SELECT id, tag, doc, type FROM t1 WHERE 
 id	tag	doc	type
 sakila	1	Some text goes here	text
 DROP TABLE t1;
+CREATE TABLE t1 (
+var1 int(2) NOT NULL,
+var2 int(2) NOT NULL,
+PRIMARY KEY  (var1)
+) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+CREATE TABLE t2 (
+var1 int(2) NOT NULL,
+var2 int(2) NOT NULL,
+PRIMARY KEY  (var1)
+) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
+CREATE TRIGGER testtrigger
+AFTER UPDATE ON t1 FOR EACH ROW BEGIN
+REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
+DROP TRIGGER testtrigger;
+DROP TABLE t1, t2;

--- 1.7/mysql-test/t/ndb_read_multi_range.test	2007-01-31 22:38:18 +01:00
+++ 1.8/mysql-test/t/ndb_read_multi_range.test	2007-01-31 22:38:18 +01:00
@@ -253,3 +253,32 @@ SELECT id, tag, doc, type FROM t1 WHERE 
 SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
 
 DROP TABLE t1;
+
+#bug#25522
+CREATE TABLE t1 (
+       var1 int(2) NOT NULL,
+       var2 int(2) NOT NULL,
+       PRIMARY KEY  (var1)
+     ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+
+
+CREATE TABLE t2 (
+       var1 int(2) NOT NULL,
+       var2 int(2) NOT NULL,
+       PRIMARY KEY  (var1)
+     ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
+
+
+DELIMITER |;
+CREATE TRIGGER testtrigger
+     AFTER UPDATE ON t1 FOR EACH ROW BEGIN
+     REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
+DELIMITER ;|
+
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+
+UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
+
+DROP TRIGGER testtrigger;
+
+DROP TABLE t1, t2;
Thread
bk commit into 5.0 tree (mskold:1.2295) BUG#25522Martin Skold31 Jan