List:Commits« Previous MessageNext Message »
From:jmiller Date:October 4 2007 9:02pm
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-04 23:02:25+02:00, jmiller@stripped +2 -0
  ndb_alter_table_online2.result:
    Updated result file
  ndb_alter_table_online2.test:
    Updated tests to add comments and checks. In addition, added test case for partitions to ensure ER_NOT_SUPPORTED_YET 1235 was returned

  mysql-test/suite/ndb/r/ndb_alter_table_online2.result@stripped, 2007-10-04 23:02:12+02:00, jmiller@stripped +85 -2
    Updated result file

  mysql-test/suite/ndb/t/ndb_alter_table_online2.test@stripped, 2007-10-04 22:55:40+02:00, jmiller@stripped +100 -6
    Updated tests to add comments and checks. In addition, added test case for partitions to ensure ER_NOT_SUPPORTED_YET 1235 was returned

diff -Nrup a/mysql-test/suite/ndb/r/ndb_alter_table_online2.result b/mysql-test/suite/ndb/r/ndb_alter_table_online2.result
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online2.result	2007-09-13 20:45:03 +02:00
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online2.result	2007-10-04 23:02:12 +02:00
@@ -1,13 +1,96 @@
 DROP TABLE IF EXISTS t1;
 CREATE DATABASE IF NOT EXISTS mysqlslap;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ basic online alter test during load
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 create table t1 (pk int key, a int) engine ndb;
 insert into t1 values (1,0);
-alter table t1 add b int;
+
+ndb_show_tables completed.....
+
+set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables_results;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Starting mysqlslap
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Alter table t1 add column b
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+
+ALTER ONLINE TABLE t1 ADD b INT;
 Warnings:
 Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Check table t1 ID has not changed
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+ndb_show_tables completed.....
+
+select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+'t1'
+truncate ndb_show_tables_results;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Starting mysqlslap using column b
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+
 update t1 set b= 0;
-alter table t1 add c int;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Alter table t1 add column c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ALTER ONLINE TABLE t1 ADD c INT;
 Warnings:
 Warning	1475	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Check table t1 ID has not changed
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+ndb_show_tables completed.....
+
+select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+'t1'
+truncate ndb_show_tables_results;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Starting mysqlslap using column c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 update t1 set c= 0;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Alter table t1 and try to add partitions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ALTER ONLINE TABLE t1 PARTITION BY HASH(pk);
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 PARTITION BY HASH(pk)'
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ Check table t1 ID has not changed
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+ndb_show_tables completed.....
+
+select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+name
+'t1'
+truncate ndb_show_tables_results;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ cleanup section
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 drop table t1;
diff -Nrup a/mysql-test/suite/ndb/t/ndb_alter_table_online2.test b/mysql-test/suite/ndb/t/ndb_alter_table_online2.test
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online2.test	2007-09-15 14:04:21 +02:00
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online2.test	2007-10-04 22:55:40 +02:00
@@ -1,3 +1,14 @@
+#############################################################
+# Author: Tomas
+# Date: 2007-09
+# Purpose: online alter under load test
+##############################################################
+# Change Author: Jonathan
+# Date 2007-10
+# Purpose: Add testing for online alter w/partitions
+#          and some original test cleanup and additions
+##############################################################
+
 -- source include/have_multi_ndb.inc
 -- source include/not_embedded.inc
 -- source include/have_log_bin.inc
@@ -6,17 +17,29 @@
 DROP TABLE IF EXISTS t1;
 CREATE DATABASE IF NOT EXISTS mysqlslap;
 --enable_warnings
-#
-# basic online alter test during load
-#
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ basic online alter test during load
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
 
 create table t1 (pk int key, a int) engine ndb;
 insert into t1 values (1,0);
 
+--source include/ndb_show_tables_result.inc
+set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
+truncate ndb_show_tables_results;
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Starting mysqlslap
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
 let $end_mysqlslap= 5000;
 --exec $MYSQL_SLAP --silent --query="update test.t1 set a=a+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
 
-
 # wait for 100 updates
 --disable_result_log
 --disable_query_log
@@ -31,8 +54,31 @@ while ($val)
 --enable_result_log
 --enable_query_log
 
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Alter table t1 add column b
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+--echo
+
 # add a column online
-alter table t1 add b int;
+ALTER ONLINE TABLE t1 ADD b INT;
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Check table t1 ID has not changed
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
+--source include/ndb_show_tables_result.inc
+select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+truncate ndb_show_tables_results;
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Starting mysqlslap using column b
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+--echo
+
 update t1 set b= 0;
 --exec $MYSQL_SLAP --silent --query="update test.t1 set b=b+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
 
@@ -50,8 +96,31 @@ while ($val)
 --enable_result_log
 --enable_query_log
 
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Alter table t1 add column c
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
 # add a column online
-alter table t1 add c int;
+ALTER ONLINE TABLE t1 ADD c INT;
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Check table t1 ID has not changed
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
+--source include/ndb_show_tables_result.inc
+select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+truncate ndb_show_tables_results;
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Starting mysqlslap using column c
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
 update t1 set c= 0;
 --exec $MYSQL_SLAP --silent --query="update test.t1 set c=c+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
 
@@ -68,6 +137,31 @@ while ($val)
 }
 --enable_result_log
 --enable_query_log
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Alter table t1 and try to add partitions
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
+--error ER_NOT_SUPPORTED_YET
+ALTER ONLINE TABLE t1 PARTITION BY HASH(pk);
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ Check table t1 ID has not changed
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
+
+--source include/ndb_show_tables_result.inc
+select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
+truncate ndb_show_tables_results;
+
+--echo
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo ~ cleanup section
+--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--echo
 
 # drop the table
 drop table t1;
Thread
bk commit into 5.1 tree (jmiller:1.2644)jmiller4 Oct