List:Commits« Previous MessageNext Message »
From:jmiller Date:October 3 2007 10:54am
Subject:bk commit into 5.1 tree (jmiller:1.2644)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of ndbdev. When ndbdev does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-03 12:54:03+02:00, jmiller@stripped +2 -0
  Merge jmiller@stripped:/home/bk/mysql-5.1-telco-6.2
  into  mysql.com:/data1/pending_review/mysql-5.1-telco-6.2
  MERGE: 1.2482.135.1

  mysql-test/suite/ndb/r/ndb_alter_table_online.result@stripped, 2007-10-03 12:45:23+02:00, jmiller@stripped +46 -35
    MERGE: 1.3.1.11

  mysql-test/suite/ndb/r/ndb_alter_table_online.result@stripped, 2007-10-03 12:38:00+02:00, jmiller@stripped +0 -0
    Merge rename: mysql-test/r/ndb_alter_table_online.result -> mysql-test/suite/ndb/r/ndb_alter_table_online.result

  mysql-test/suite/ndb/t/ndb_alter_table_online.test@stripped, 2007-10-03 12:53:45+02:00, jmiller@stripped +63 -62
    MERGE: 1.1.1.10

  mysql-test/suite/ndb/t/ndb_alter_table_online.test@stripped, 2007-10-03 12:38:00+02:00, jmiller@stripped +0 -0
    Merge rename: mysql-test/t/ndb_alter_table_online.test -> mysql-test/suite/ndb/t/ndb_alter_table_online.test

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jmiller
# Host:	ndb15.mysql.com
# Root:	/data1/pending_review/mysql-5.1-telco-6.2/RESYNC

--- 1.4/mysql-test/r/ndb_alter_table_online.result	2007-10-03 12:54:10 +02:00
+++ 1.6/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2007-10-03 12:54:10 +02:00
@@ -1,7 +1,16 @@
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
 INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
 ALTER TABLE t1 ADD c CHAR(19);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+'t1'
+truncate ndb_show_tables;
 INSERT INTO t1 values (2,1,"a");
 SELECT * FROM t1 ORDER BY a;
 a	b	c
@@ -10,24 +19,38 @@
 DROP TABLE t1;
 CREATE TABLE t1 (a INT UNSIGNED KEY, b VARCHAR(19)) ENGINE NDB;
 INSERT INTO t1 values (1,"a");
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
 ALTER TABLE t1 ADD c INT;
 Warnings:
-Warning	1466	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+'t1'
+truncate ndb_show_tables;
 INSERT INTO t1 values (2,"a",1);
 SELECT * FROM t1 ORDER BY a;
 a	b	c
 1	a	NULL
 2	a	1
 DROP TABLE t1;
-*******************************
-* Alter Table online add column
-*******************************
-* Add column c as nullable INT
-*******************************
-CREATE TABLE t1 (a INT UNSIGNED  AUTO_INCREMENT KEY, b INT DEFAULT 2 COLUMN_FORMAT DYNAMIC) ENGINE NDB;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT COLUMN_FORMAT DYNAMIC) ENGINE NDB;
+INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
 ALTER TABLE t1 ADD c INT;
 Warnings:
 Warning	1466	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+INSERT INTO t1 values (2,1,1);
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	NULL
+2	1	1
+DROP TABLE t1;
+Warning	1466	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
 -- t1 --
 Version: 16777219
 Fragment type: 5
@@ -353,3 +376,257 @@
 NDBT_ProgramExit: 0 - OK
 
 DROP TABLE t1;
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%';
+id	name
+5	't1'
+truncate ndb_show_tables;
+INSERT INTO t1 values (2,1,1);
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	NULL
+2	1	1
+CREATE ONLINE INDEX ci on t1(c);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+id	name
+5	't1'
+truncate ndb_show_tables;
+CREATE OFFLINE INDEX ci2 on t1(c);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+id	name
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+DROP ONLINE INDEX ci on t1;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+id	name
+8	't1'
+truncate ndb_show_tables;
+DROP OFFLINE INDEX ci2 on t1;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+id	name
+truncate ndb_show_tables;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+insert into t1 values (1,1);
+insert into t1 values (2,2);
+insert into t1 values (3,3);
+insert into t1 values (4,4);
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1      where a = 3;
+insert into t1 values (5,5);
+insert into t1 values (6,6);
+update t1 set b = 0 where a = 6;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+Warnings:
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null);
+insert into t1 values (8,0,'8','8','8');
+commit;
+SELECT * FROM t1 ORDER BY a;
+a	b	c	d	e
+1	0	NULL	NULL	NULL
+2	0	NULL	NULL	NULL
+4	0	NULL	NULL	NULL
+5	0	NULL	NULL	NULL
+6	0	NULL	NULL	NULL
+7	0	NULL	NULL	NULL
+8	0	8	8	8
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+INSERT INTO t1 values (1,1);
+insert into t1 values (2,2);
+insert into t1 values (3,3);
+insert into t1 values (4,4);
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1      where a = 3;
+insert into t1 values (5,5);
+insert into t1 values (6,6);
+update t1 set b = 0 where a = 6;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+Warnings:
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null);
+insert into t1 values (8,0,'8','8','8');
+rollback;
+SELECT * FROM t1 ORDER BY a;
+a	b	c	d	e
+1	1	NULL	NULL	NULL
+2	2	NULL	NULL	NULL
+3	3	NULL	NULL	NULL
+4	4	NULL	NULL	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=FIXED ENGINE NDB;
+INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+ALTER ONLINE TABLE t1 ADD c CHAR(19);
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19)'
+ALTER TABLE t1 ADD c CHAR(19);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+truncate ndb_show_tables;
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	NULL
+2	1	a
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17'
+ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+truncate ndb_show_tables;
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	17
+2	1	a
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+ALTER ONLINE TABLE t1 ADD d INT AFTER b;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD d INT AFTER b'
+ALTER TABLE t1 ADD d INT AFTER b;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+truncate ndb_show_tables;
+SELECT * FROM t1 ORDER BY a;
+a	b	d	c
+1	1	NULL	17
+2	1	NULL	a
+ALTER ONLINE TABLE t1 ENGINE MYISAM;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ENGINE MYISAM'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+ALTER ONLINE TABLE t1 ADD c TIMESTAMP;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c TIMESTAMP'
+ALTER TABLE t1 ADD c TIMESTAMP;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+truncate ndb_show_tables;
+INSERT INTO t1 values (2,2,'2007-09-19 18:46:02');
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	0000-00-00 00:00:00
+2	2	2007-09-19 18:46:02
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL'
+ALTER TABLE t1 ADD c CHAR(19) NOT NULL;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+truncate ndb_show_tables;
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	
+2	1	a
+DROP TABLE t1;
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED'
+ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+truncate ndb_show_tables;
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+a	b	c
+1	1	NULL
+2	1	a
+DROP TABLE t1;
+CREATE TABLE t1 (
+auto int(5) unsigned NOT NULL auto_increment,
+string char(10),
+vstring varchar(10),
+bin binary(2),
+vbin varbinary(7),
+tiny tinyint(4) DEFAULT '0' NOT NULL ,
+short smallint(6) DEFAULT '1' NOT NULL ,
+medium mediumint(8) DEFAULT '0' NOT NULL,
+long_int int(11) DEFAULT '0' NOT NULL,
+longlong bigint(13) DEFAULT '0' NOT NULL,
+real_float float(13,1) DEFAULT 0.0 NOT NULL,
+real_double double(16,4),
+real_decimal decimal(16,4),
+utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
+ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
+umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
+ulong int(11) unsigned DEFAULT '0' NOT NULL,
+ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
+bits bit(3),
+options enum('zero','one','two','three','four') not null,
+flags set('zero','one','two','three','four') not null,
+date_field date,
+year_field year,
+time_field time,
+date_time datetime,
+time_stamp timestamp,
+PRIMARY KEY (auto)
+) engine=ndb;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+ERROR 42000: This version of MySQL doesn't yet support 'alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL'
+alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+create index i1 on t1(medium);
+alter table t1 add index i2(new_tiny);
+drop index i1 on t1;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+'t1'
+DROP TABLE t1;
+DROP TABLE ndb_show_tables;
+>>>>>>>

--- 1.2/mysql-test/t/ndb_alter_table_online.test	2007-10-03 12:54:10 +02:00
+++ 1.4/mysql-test/suite/ndb/t/ndb_alter_table_online.test	2007-10-03 12:54:10 +02:00
@@ -19,16 +19,57 @@
 # basic online alter test
 ######################################
 
-CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+
+CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
 INSERT INTO t1 values (1,1);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
 ALTER TABLE t1 ADD c CHAR(19);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
 INSERT INTO t1 values (2,1,"a");
 SELECT * FROM t1 ORDER BY a;
 DROP TABLE t1;
 
 CREATE TABLE t1 (a INT UNSIGNED KEY, b VARCHAR(19)) ENGINE NDB;
 INSERT INTO t1 values (1,"a");
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
 ALTER TABLE t1 ADD c INT;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
 INSERT INTO t1 values (2,"a",1);
 SELECT * FROM t1 ORDER BY a;
 DROP TABLE t1;
@@ -57,6 +98,14 @@
 }
 enable_query_log;
 
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
 ALTER TABLE t1 ADD c INT;
 
 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1
@@ -358,3 +407,371 @@
 
 # End of 5.1 Test Case
 
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%';
+
+truncate ndb_show_tables;
+
+INSERT INTO t1 values (2,1,1);
+SELECT * FROM t1 ORDER BY a;
+
+CREATE ONLINE INDEX ci on t1(c);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+ 
+CREATE OFFLINE INDEX ci2 on t1(c);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+
+truncate ndb_show_tables;
+ 
+DROP ONLINE INDEX ci on t1;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+DROP OFFLINE INDEX ci2 on t1;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select id,name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+DROP TABLE t1;
+
+#
+# basic concurent online alter test
+#
+connection server1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+insert into t1 values (1,1);
+insert into t1 values (2,2);
+insert into t1 values (3,3);
+insert into t1 values (4,4);
+
+connection server2;
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1      where a = 3;
+
+insert into t1 values (5,5);
+insert into t1 values (6,6);
+update t1 set b = 0 where a = 6;
+
+connection server1;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+
+connection server2;
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null);
+insert into t1 values (8,0,'8','8','8');
+commit;
+
+connection server1;
+SELECT * FROM t1 ORDER BY a;
+
+DROP TABLE t1;
+
+connection server1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+INSERT INTO t1 values (1,1);
+insert into t1 values (2,2);
+insert into t1 values (3,3);
+insert into t1 values (4,4);
+
+connection server2;
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1      where a = 3;
+
+insert into t1 values (5,5);
+insert into t1 values (6,6);
+update t1 set b = 0 where a = 6;
+
+connection server1;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+
+connection server2;
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null);
+insert into t1 values (8,0,'8','8','8');
+rollback;
+
+connection server1;
+SELECT * FROM t1 ORDER BY a;
+
+DROP TABLE t1;
+
+# The following ALTER operations are not supported on-line
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=FIXED ENGINE NDB;
+INSERT INTO t1 values (1,1);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ADD c CHAR(19);
+ALTER TABLE t1 ADD c CHAR(19);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17;
+ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ADD d INT AFTER b;
+ALTER TABLE t1 ADD d INT AFTER b;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+SELECT * FROM t1 ORDER BY a;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ENGINE MYISAM;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ADD c TIMESTAMP;
+ALTER TABLE t1 ADD c TIMESTAMP;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+INSERT INTO t1 values (2,2,'2007-09-19 18:46:02');
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL;
+ALTER TABLE t1 ADD c CHAR(19) NOT NULL;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
+INSERT INTO t1 values (1,1);
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
+ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+truncate ndb_show_tables;
+
+INSERT INTO t1 values (2,1,"a");
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+  auto int(5) unsigned NOT NULL auto_increment,
+  string char(10),
+  vstring varchar(10),
+  bin binary(2),
+  vbin varbinary(7),
+  tiny tinyint(4) DEFAULT '0' NOT NULL ,
+  short smallint(6) DEFAULT '1' NOT NULL ,
+  medium mediumint(8) DEFAULT '0' NOT NULL,
+  long_int int(11) DEFAULT '0' NOT NULL,
+  longlong bigint(13) DEFAULT '0' NOT NULL,
+  real_float float(13,1) DEFAULT 0.0 NOT NULL,
+  real_double double(16,4),
+  real_decimal decimal(16,4),
+  utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
+  ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
+  umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
+  ulong int(11) unsigned DEFAULT '0' NOT NULL,
+  ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
+  bits bit(3),
+  options enum('zero','one','two','three','four') not null,
+  flags set('zero','one','two','three','four') not null,
+  date_field date,
+  year_field year,
+  time_field time,
+  date_time datetime,
+  time_stamp timestamp,
+  PRIMARY KEY (auto)
+) engine=ndb;
+                                                                                                   
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+# Ndb doesn't support renaming attributes on-line
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+--error ER_NOT_SUPPORTED_YET
+alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables;
+
+create index i1 on t1(medium);
+alter table t1 add index i2(new_tiny);
+drop index i1 on t1;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--exec rm $MYSQLTEST_VARDIR/master-data/test/tmp.dat || true
+--enable_warnings
+
+select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+
+DROP TABLE t1;
+
+DROP TABLE ndb_show_tables;
Thread
bk commit into 5.1 tree (jmiller:1.2644)jmiller3 Oct