| Server IP : 45.40.142.9 / Your IP : 216.73.216.250 Web Server : Apache System : Linux s45-40-142-9.secureserver.net 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : bayspec ( 506) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/mysql-test/suite/ndb/t/ |
Upload File : |
-- source include/have_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Basic test for different types of loading data
#
# should give duplicate key
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
--error 1022
LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
DROP TABLE t1;
# now without a primary key we should be ok
CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
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 default_storage_engine="ndb";
CREATE TABLE t2 AS SELECT * FROM t1;
SELECT COUNT(*) FROM t2;
DROP TABLE t2;
SET default_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;