#At file:///home/jonas/src/telco-6.4/
2888 Jonas Oreland 2008-10-07 [merge]
merge 63 to 64
modified:
mysql-test/suite/ndb/r/ndb_basic.result
mysql-test/suite/ndb/t/ndb_basic.test
sql/ha_ndbcluster.cc
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result 2008-04-09 22:34:12 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result 2008-10-06 11:03:32 +0000
@@ -935,4 +935,24 @@ create table if not exists t1 (a int not
create table t2 like t1;
rename table t1 to t10, t2 to t20;
drop table t10,t20;
+#
+# bug #39872 - explain causes segv
+# (ndb_index_stat_enable=1 must be set to trigger bug)
+#
+set ndb_index_stat_enable=1;
+CREATE TABLE `t1` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
+CREATE TABLE `t2` (
+`id` int(11) NOT NULL,
+`obj_id` int(11) DEFAULT NULL,
+UNIQUE KEY `id` (`id`),
+KEY `obj_id` (`obj_id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
+# here we used to segv
+explain SELECT t1.id FROM t1 INNER JOIN t2 ON t1.id = t2.id WHERE t2.obj_id=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+drop table t1, t2;
End of 5.1 tests
=== modified file 'mysql-test/suite/ndb/t/ndb_basic.test'
--- a/mysql-test/suite/ndb/t/ndb_basic.test 2007-11-29 10:29:35 +0000
+++ b/mysql-test/suite/ndb/t/ndb_basic.test 2008-10-06 11:03:32 +0000
@@ -857,4 +857,23 @@ create table t2 like t1;
rename table t1 to t10, t2 to t20;
drop table t10,t20;
+--echo #
+--echo # bug #39872 - explain causes segv
+--echo # (ndb_index_stat_enable=1 must be set to trigger bug)
+--echo #
+set ndb_index_stat_enable=1;
+CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
+CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `obj_id` int(11) DEFAULT NULL,
+ UNIQUE KEY `id` (`id`),
+ KEY `obj_id` (`obj_id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
+--echo # here we used to segv
+explain SELECT t1.id FROM t1 INNER JOIN t2 ON t1.id = t2.id WHERE t2.obj_id=1;
+drop table t1, t2;
+
--echo End of 5.1 tests
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2008-10-03 12:02:23 +0000
+++ b/sql/ha_ndbcluster.cc 2008-10-07 06:57:14 +0000
@@ -4505,6 +4505,14 @@ int ha_ndbcluster::rnd_init(bool scan)
int ha_ndbcluster::close_scan()
{
+ /*
+ workaround for bug #39872 - explain causes segv
+ - rnd_end/close_scan is called on unlocked table
+ - should be fixed in server code, but this will
+ not be done until 6.0 as it is too intrusive
+ */
+ if (m_thd_ndb == NULL)
+ return 0;
NdbTransaction *trans= m_thd_ndb->trans;
int error;
DBUG_ENTER("close_scan");
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (jonas:2888) | Jonas Oreland | 7 Oct |