Loading mysql-test/r/grant2.result +22 −0 Original line number Diff line number Diff line Loading @@ -334,3 +334,25 @@ lock table mysql.user write; revoke all on *.* from 'mysqltest_1'@'localhost'; unlock tables; drop user 'mysqltest_1'@'localhost'; create database TESTDB; create table t2(a int); create temporary table t1 as select * from mysql.user; delete from mysql.user where host='localhost'; INSERT INTO mysql.user VALUES ('%','mysqltest_1',password('password'),'N','N','N','N','N','N', 'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N', '','','','',0,0,0,0); INSERT INTO mysql.db VALUES ('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y',' Y','N'); Warnings: Warning 1265 Data truncated for column 'Alter_routine_priv' at row 1 FLUSH PRIVILEGES; create database TEStdb; ERROR 42000: Access denied for user 'mysqltest_1'@'%' to database 'TEStdb' delete from mysql.user; delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB'; insert into mysql.user select * from t1; drop table t1, t2; drop database TESTDB; flush privileges; mysql-test/r/ndb_cache_multi2.result +10 −14 Original line number Diff line number Diff line drop table if exists t1, t2; == Connected to server1 == set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; reset query cache; flush status; == Connected to server2 == set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; reset query cache; flush status; == Connected to server1 == create table t1 (a int) engine=ndbcluster; create table t2 (a int) engine=ndbcluster; insert into t1 value (2); Loading @@ -16,18 +19,22 @@ insert into t2 value (3); select * from t1; a 2 select a != 3 from t1; a != 3 1 select * from t2; a 3 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 2 Qcache_queries_in_cache 3 show status like "Qcache_inserts"; Variable_name Value Qcache_inserts 2 Qcache_inserts 3 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 == Connected to server2 == show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 Loading @@ -50,24 +57,13 @@ show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 update t1 set a=3 where a=2; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 2 show status like "Qcache_inserts"; Variable_name Value Qcache_inserts 2 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 == Connected to server1 == select * from t1; a 3 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 3 show status like "Qcache_inserts"; Variable_name Value Qcache_inserts 4 drop table t1, t2; set GLOBAL query_cache_size=0; set GLOBAL ndb_cache_check_time=0; Loading mysql-test/t/grant2.test +35 −0 Original line number Diff line number Diff line Loading @@ -429,3 +429,38 @@ disconnect con2root; disconnect con3root; # End of 4.1 tests # # Bug#17279 user with no global privs and with create # priv in db can create databases # create database TESTDB; create table t2(a int); create temporary table t1 as select * from mysql.user; delete from mysql.user where host='localhost'; INSERT INTO mysql.user VALUES ('%','mysqltest_1',password('password'),'N','N','N','N','N','N', 'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N', '','','','',0,0,0,0); INSERT INTO mysql.db VALUES ('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y',' Y','N'); FLUSH PRIVILEGES; connect (con1,localhost,mysqltest_1,password,TESTDB); # The user mysqltest_1 should only be allowed access to # database TESTDB, not TEStdb --error 1044 create database TEStdb; # Clean-up connection default; delete from mysql.user; delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB'; insert into mysql.user select * from t1; drop table t1, t2; drop database TESTDB; flush privileges; mysql-test/t/ndb_cache_multi2.test +8 −6 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ drop table if exists t1, t2; # Turn on and reset query cache on server1 connection server1; echo == Connected to server1 ==; set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; Loading @@ -18,6 +19,7 @@ flush status; # Turn on and reset query cache on server2 connection server2; echo == Connected to server2 ==; set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; Loading @@ -27,11 +29,14 @@ flush status; # Create test tables in NDB and load them into cache # on server1 connection server1; echo == Connected to server1 ==; create table t1 (a int) engine=ndbcluster; create table t2 (a int) engine=ndbcluster; insert into t1 value (2); insert into t2 value (3); select * from t1; # Run the check query once to load it into qc on server1 select a != 3 from t1; select * from t2; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; Loading @@ -40,6 +45,7 @@ show status like "Qcache_hits"; # Connect server2, load table in to cache, then update the table connection server2; echo == Connected to server2 ==; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; Loading @@ -52,9 +58,7 @@ update t1 set a=3 where a=2; # Connect to server1 and check that cache is invalidated # and correct data is returned connection server1; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; echo == Connected to server1 ==; # Loop and wait for max 10 seconds until query cache thread # has invalidated the cache and the column a in t1 is equal to 3 Loading @@ -75,8 +79,6 @@ select * from t1; # There should now be three queries in the cache show status like "Qcache_queries_in_cache"; # And inserts should be four show status like "Qcache_inserts"; drop table t1, t2; Loading sql/ha_ndbcluster.cc +1 −1 Original line number Diff line number Diff line Loading @@ -6014,7 +6014,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ndb_util_thread= pthread_self(); thd->thread_stack= (char*)&thd; /* remember where our stack is */ if (thd->store_globals() && (ndb->init() != -1)) if (thd->store_globals() || (ndb->init() != 0)) { thd->cleanup(); delete thd; Loading Loading
mysql-test/r/grant2.result +22 −0 Original line number Diff line number Diff line Loading @@ -334,3 +334,25 @@ lock table mysql.user write; revoke all on *.* from 'mysqltest_1'@'localhost'; unlock tables; drop user 'mysqltest_1'@'localhost'; create database TESTDB; create table t2(a int); create temporary table t1 as select * from mysql.user; delete from mysql.user where host='localhost'; INSERT INTO mysql.user VALUES ('%','mysqltest_1',password('password'),'N','N','N','N','N','N', 'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N', '','','','',0,0,0,0); INSERT INTO mysql.db VALUES ('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y',' Y','N'); Warnings: Warning 1265 Data truncated for column 'Alter_routine_priv' at row 1 FLUSH PRIVILEGES; create database TEStdb; ERROR 42000: Access denied for user 'mysqltest_1'@'%' to database 'TEStdb' delete from mysql.user; delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB'; insert into mysql.user select * from t1; drop table t1, t2; drop database TESTDB; flush privileges;
mysql-test/r/ndb_cache_multi2.result +10 −14 Original line number Diff line number Diff line drop table if exists t1, t2; == Connected to server1 == set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; reset query cache; flush status; == Connected to server2 == set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; reset query cache; flush status; == Connected to server1 == create table t1 (a int) engine=ndbcluster; create table t2 (a int) engine=ndbcluster; insert into t1 value (2); Loading @@ -16,18 +19,22 @@ insert into t2 value (3); select * from t1; a 2 select a != 3 from t1; a != 3 1 select * from t2; a 3 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 2 Qcache_queries_in_cache 3 show status like "Qcache_inserts"; Variable_name Value Qcache_inserts 2 Qcache_inserts 3 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 == Connected to server2 == show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 Loading @@ -50,24 +57,13 @@ show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 update t1 set a=3 where a=2; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 2 show status like "Qcache_inserts"; Variable_name Value Qcache_inserts 2 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 == Connected to server1 == select * from t1; a 3 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 3 show status like "Qcache_inserts"; Variable_name Value Qcache_inserts 4 drop table t1, t2; set GLOBAL query_cache_size=0; set GLOBAL ndb_cache_check_time=0; Loading
mysql-test/t/grant2.test +35 −0 Original line number Diff line number Diff line Loading @@ -429,3 +429,38 @@ disconnect con2root; disconnect con3root; # End of 4.1 tests # # Bug#17279 user with no global privs and with create # priv in db can create databases # create database TESTDB; create table t2(a int); create temporary table t1 as select * from mysql.user; delete from mysql.user where host='localhost'; INSERT INTO mysql.user VALUES ('%','mysqltest_1',password('password'),'N','N','N','N','N','N', 'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N', '','','','',0,0,0,0); INSERT INTO mysql.db VALUES ('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y',' Y','N'); FLUSH PRIVILEGES; connect (con1,localhost,mysqltest_1,password,TESTDB); # The user mysqltest_1 should only be allowed access to # database TESTDB, not TEStdb --error 1044 create database TEStdb; # Clean-up connection default; delete from mysql.user; delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB'; insert into mysql.user select * from t1; drop table t1, t2; drop database TESTDB; flush privileges;
mysql-test/t/ndb_cache_multi2.test +8 −6 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ drop table if exists t1, t2; # Turn on and reset query cache on server1 connection server1; echo == Connected to server1 ==; set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; Loading @@ -18,6 +19,7 @@ flush status; # Turn on and reset query cache on server2 connection server2; echo == Connected to server2 ==; set GLOBAL query_cache_type=on; set GLOBAL query_cache_size=1355776; set GLOBAL ndb_cache_check_time=1; Loading @@ -27,11 +29,14 @@ flush status; # Create test tables in NDB and load them into cache # on server1 connection server1; echo == Connected to server1 ==; create table t1 (a int) engine=ndbcluster; create table t2 (a int) engine=ndbcluster; insert into t1 value (2); insert into t2 value (3); select * from t1; # Run the check query once to load it into qc on server1 select a != 3 from t1; select * from t2; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; Loading @@ -40,6 +45,7 @@ show status like "Qcache_hits"; # Connect server2, load table in to cache, then update the table connection server2; echo == Connected to server2 ==; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; Loading @@ -52,9 +58,7 @@ update t1 set a=3 where a=2; # Connect to server1 and check that cache is invalidated # and correct data is returned connection server1; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; echo == Connected to server1 ==; # Loop and wait for max 10 seconds until query cache thread # has invalidated the cache and the column a in t1 is equal to 3 Loading @@ -75,8 +79,6 @@ select * from t1; # There should now be three queries in the cache show status like "Qcache_queries_in_cache"; # And inserts should be four show status like "Qcache_inserts"; drop table t1, t2; Loading
sql/ha_ndbcluster.cc +1 −1 Original line number Diff line number Diff line Loading @@ -6014,7 +6014,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ndb_util_thread= pthread_self(); thd->thread_stack= (char*)&thd; /* remember where our stack is */ if (thd->store_globals() && (ndb->init() != -1)) if (thd->store_globals() || (ndb->init() != 0)) { thd->cleanup(); delete thd; Loading