From 6656d39c7216cc07b457f090d5432168e668582d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Aug 2007 15:07:17 +1000 Subject: [PATCH] Backport Magnus' fix from 5.1 ChangeSet@1.2575, 2007-08-07 19:16:06+02:00, msvensson@pilot.(none) +2 -0 Bug#26793 mysqld crashes when doing specific query on information_schema - Drop the newly created user user1@localhost - Cleanup testcase mysql-test/r/ndb_bug26793.result: mysql-test/r/ndb_bug26793.result@1.3, 2007-08-07 19:16:04+02:00, msvensson@pilot.(none) +1 -6 Update test result mysql-test/t/ndb_bug26793.test: mysql-test/t/ndb_bug26793.test@1.3, 2007-08-07 19:16:04+02:00, msvensson@pilot.(none) +8 -11 - Remove the drop/restore of anonymous users - there are no such users by default anymore(if there were, they would probably be in mysql.user) - Switch back to default connection before cleanup - Drop user1@localhost as part of cleanup --- mysql-test/r/ndb_bug26793.result | 7 +------ mysql-test/t/ndb_bug26793.test | 21 +++++++++------------ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/ndb_bug26793.result b/mysql-test/r/ndb_bug26793.result index 31f9763dd6b..a9a8a798546 100644 --- a/mysql-test/r/ndb_bug26793.result +++ b/mysql-test/r/ndb_bug26793.result @@ -3,11 +3,6 @@ CREATE TABLE `test` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `t` VARCHAR( 10 ) NOT NULL ) ENGINE = ndbcluster; -create table test.db_temp as select * from mysql.db where user=''; -delete from mysql.db where user=''; -flush privileges; GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass'; DROP TABLE `test`.`test`; -insert into mysql.db select * from test.db_temp; -drop table db_temp; -flush privileges; +drop user user1@localhost; diff --git a/mysql-test/t/ndb_bug26793.test b/mysql-test/t/ndb_bug26793.test index 4f5a78fdca4..f35d8808c1a 100644 --- a/mysql-test/t/ndb_bug26793.test +++ b/mysql-test/t/ndb_bug26793.test @@ -9,15 +9,12 @@ CREATE TABLE `test` ( `t` VARCHAR( 10 ) NOT NULL ) ENGINE = ndbcluster; -create table test.db_temp as select * from mysql.db where user=''; -delete from mysql.db where user=''; - -flush privileges; - +# Add user1@localhost with a specific password +# and connect as that user GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass'; - connect (user1,localhost,user1,pass,*NO-ONE*); +# Run the query 100 times disable_query_log; disable_result_log; let $i= 100; @@ -29,10 +26,10 @@ dec $i; enable_query_log; enable_result_log; -connect (root,localhost,root,,test); -connection root; -DROP TABLE `test`.`test`; -insert into mysql.db select * from test.db_temp; -drop table db_temp; -flush privileges; +disconnect user1; + +# Switch back to the default connection and cleanup +connection default; +DROP TABLE `test`.`test`; +drop user user1@localhost;