From b50015f280f2eca4676267c79e868c2a0b511016 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Jul 2007 20:24:54 +1000 Subject: [PATCH 1/2] [PATCH] BUG#26793 test: mysqld crashes in NDB on I_S query Reduce case and formalise into something we should be able to use in mysql-test-run. Index: ndb-work/mysql-test/t/ndb_bug26793.test =================================================================== mysql-test/r/ndb_bug26793.result: BUG#26793 test: mysqld crashes in NDB on I_S query mysql-test/t/ndb_bug26793.test: BUG#26793 test: mysqld crashes in NDB on I_S query --- mysql-test/r/ndb_bug26793.result | 9 +++++++++ mysql-test/t/ndb_bug26793.test | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 mysql-test/r/ndb_bug26793.result create mode 100644 mysql-test/t/ndb_bug26793.test diff --git a/mysql-test/r/ndb_bug26793.result b/mysql-test/r/ndb_bug26793.result new file mode 100644 index 00000000000..9a15841e670 --- /dev/null +++ b/mysql-test/r/ndb_bug26793.result @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE `test` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`t` VARCHAR( 10 ) NOT NULL +) ENGINE = ndbcluster; +delete from mysql.db where user=''; +flush privileges; +GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass'; +DROP TABLE `test`.`test`; diff --git a/mysql-test/t/ndb_bug26793.test b/mysql-test/t/ndb_bug26793.test new file mode 100644 index 00000000000..66595639c3e --- /dev/null +++ b/mysql-test/t/ndb_bug26793.test @@ -0,0 +1,33 @@ +-- source include/have_ndb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE `test` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`t` VARCHAR( 10 ) NOT NULL +) ENGINE = ndbcluster; + +delete from mysql.db where user=''; + +flush privileges; + +GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass'; + +connect (user1,localhost,user1,pass,*NO-ONE*); + +disable_query_log; +disable_result_log; +let $i= 100; +while ($i) +{ +select count(*) from information_schema.tables union all select count(*) from information_schema.tables union all select count(*) from information_schema.tables; +dec $i; +} +enable_query_log; +enable_result_log; + +connect (root,localhost,root,,test); +connection root; +DROP TABLE `test`.`test`; From ffa5fb613d6078ddaef0e9476e30da557fa4ad6b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Jul 2007 20:25:05 +1000 Subject: [PATCH 2/2] [PATCH] Bug#26793 I_S query crashes in NDB If ::exteral_lock hadn't been called, we'd have no NDB object, so need to check/get one here. It looks like sql_show.cc is the only place that does this.... or at least the other places will be well hidden. Index: ndb-work/sql/ha_ndbcluster.cc =================================================================== sql/ha_ndbcluster.cc: Bug#26793 I_S query crashes in NDB --- sql/ha_ndbcluster.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 357b797ec75..03b6bcf3242 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3310,6 +3310,8 @@ int ha_ndbcluster::info(uint flag) DBUG_PRINT("info", ("HA_STATUS_AUTO")); if (m_table && table->found_next_number_field) { + if ((my_errno= check_ndb_connection())) + DBUG_RETURN(my_errno); Ndb *ndb= get_ndb(); Uint64 auto_increment_value64;