#At file:///home/frazer/bzr/mysql-5.1-telco-6.3/
2929 Frazer Clement 2009-04-06
Bug#43236 : ndb_use_transactions is ignored in 6.4.3. Testcases added to 6.3 + and fix added to 6.4
modified:
mysql-test/suite/ndb/r/ndb_load.result
mysql-test/suite/ndb/t/ndb_load.test
=== modified file 'mysql-test/suite/ndb/r/ndb_load.result'
--- a/mysql-test/suite/ndb/r/ndb_load.result 2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/ndb/r/ndb_load.result 2009-04-06 10:37:55 +0000
@@ -78,3 +78,70 @@ Abernathy
aberrant
aberration
DROP TABLE t1;
+Test single statement load from MyISAM table with and
+without ndb_use_transactions
+(Bug#43236)
+ndb_use_transactions = 0 should allow bulk inserts to
+succeed by automatically splitting into smaller
+transactions.
+CREATE TABLE t1 (a int) engine=MyIsam;
+show tables;
+Tables_in_test
+t1
+CREATE PROCEDURE bulkinsert (in num int)
+BEGIN
+set @total= num;
+repeat
+insert into t1 values (@total);
+set @total= @total -1;
+until @total = 0 end repeat;
+end %
+Insert 15000 rows which should exceed default number
+of concurrent operations (include/default_ndbd.cnf)
+when trying to move over to ndb.
+CALL bulkinsert(15000);
+show tables;
+Tables_in_test
+t1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+15000
+SET ndb_use_transactions= 1;
+CREATE TABLE t2 (a int) engine=Ndb;
+Will fail with too many concurrent operations error
+INSERT INTO t2 SELECT * FROM t1;
+ERROR HY000: Got temporary error 233 'Out of operation records in transaction coordinator (increase MaxNoOfConcurrentOperations)' from NDBCLUSTER
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SET ndb_use_transactions= 0;
+Should pass as insert is split
+into multiple transactions
+INSERT INTO t2 SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+15000
+DROP PROCEDURE bulkinsert;
+DROP TABLE t2;
+Now check bulk insert using create .. as select.
+SHOW VARIABLES LIKE '%storage_engine%';
+Variable_name Value
+storage_engine MyISAM
+SET storage_engine="ndb";
+CREATE TABLE t2 AS SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+15000
+DROP TABLE t2;
+SET storage_engine="MyIsam";
+Now check Alter table to Ndb
+ALTER TABLE t1 ENGINE= Ndb;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+15000
+Now check Alter table within Ndb
+ALTER TABLE t1 ADD COLUMN extra int default 6;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+15000
+DROP TABLE t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_load.test'
--- a/mysql-test/suite/ndb/t/ndb_load.test 2009-02-03 13:35:56 +0000
+++ b/mysql-test/suite/ndb/t/ndb_load.test 2009-04-06 10:37:55 +0000
@@ -21,3 +21,82 @@ SELECT * FROM t1 ORDER BY word;
DROP TABLE t1;
# End of 4.1 tests
+
+--echo Test single statement load from MyISAM table with and
+--echo without ndb_use_transactions
+--echo (Bug#43236)
+--echo ndb_use_transactions = 0 should allow bulk inserts to
+--echo succeed by automatically splitting into smaller
+--echo transactions.
+
+CREATE TABLE t1 (a int) engine=MyIsam;
+
+show tables;
+
+DELIMITER %;
+
+CREATE PROCEDURE bulkinsert (in num int)
+BEGIN
+ set @total= num;
+ repeat
+ insert into t1 values (@total);
+ set @total= @total -1;
+ until @total = 0 end repeat;
+end %
+
+DELIMITER ;%
+
+
+--echo Insert 15000 rows which should exceed default number
+--echo of concurrent operations (include/default_ndbd.cnf)
+--echo when trying to move over to ndb.
+CALL bulkinsert(15000);
+
+show tables;
+
+SELECT COUNT(*) FROM t1;
+
+SET ndb_use_transactions= 1;
+
+CREATE TABLE t2 (a int) engine=Ndb;
+
+--echo Will fail with too many concurrent operations error
+--error 1297
+INSERT INTO t2 SELECT * FROM t1;
+
+SELECT COUNT(*) FROM t2;
+
+SET ndb_use_transactions= 0;
+
+--echo Should pass as insert is split
+--echo into multiple transactions
+INSERT INTO t2 SELECT * FROM t1;
+
+SELECT COUNT(*) FROM t2;
+
+DROP PROCEDURE bulkinsert;
+DROP TABLE t2;
+
+--echo Now check bulk insert using create .. as select.
+SHOW VARIABLES LIKE '%storage_engine%';
+SET storage_engine="ndb";
+
+CREATE TABLE t2 AS SELECT * FROM t1;
+
+SELECT COUNT(*) FROM t2;
+
+DROP TABLE t2;
+
+SET storage_engine="MyIsam";
+
+--echo Now check Alter table to Ndb
+ALTER TABLE t1 ENGINE= Ndb;
+
+SELECT COUNT(*) FROM t1;
+
+--echo Now check Alter table within Ndb
+ALTER TABLE t1 ADD COLUMN extra int default 6;
+
+SELECT COUNT(*) FROM t1;
+
+DROP TABLE t1;
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (frazer:2929) Bug#43236 | Frazer Clement | 6 Apr |