From 922818a79809d789976e64a8b4faabd305863a7c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Mar 2004 23:08:42 +0200 Subject: [PATCH] Updated tests after merge mysql-test/r/alter_table.result: Updated tests mysql-test/t/alter_table.test: Updated tests --- mysql-test/r/alter_table.result | 71 +++++++++++++++++++-------------- mysql-test/t/alter_table.test | 4 +- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 037d3420f76..c2fd5161353 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +drop database if exists mysqltest; create table t1 ( col1 int not null auto_increment primary key, col2 varchar(30) not null, @@ -85,6 +86,45 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK DROP TABLE t1; +create table t1 (i int unsigned not null auto_increment primary key); +insert into t1 values (null),(null),(null),(null); +alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i); +select * from t1; +i +1 +2 +3 +4 +drop table t1; +create table t1 (name char(15)); +insert into t1 (name) values ("current"); +create database mysqltest; +create table mysqltest.t1 (name char(15)); +insert into mysqltest.t1 (name) values ("mysqltest"); +select * from t1; +name +current +select * from mysqltest.t1; +name +mysqltest +alter table t1 rename mysqltest.t1; +Table 't1' already exists +select * from t1; +name +current +select * from mysqltest.t1; +name +mysqltest +drop table t1; +drop database mysqltest; +create database mysqltest; +create table mysqltest.t1 (a int,b int,c int); +grant all on mysqltest.t1 to mysqltest_1@localhost; +alter table t1 rename t2; +insert command denied to user: 'mysqltest_1@localhost' for table 't2' +revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +drop database mysqltest; create table t1 (n1 int not null, n2 int, n3 int, n4 float, unique(n1), key (n1, n2, n3, n4), @@ -143,16 +183,6 @@ t1 1 n4 3 n2 A 10 NULL NULL YES BTREE t1 1 n4 4 n3 A 10 NULL NULL YES BTREE drop table t1; create table t1 (i int unsigned not null auto_increment primary key); -insert into t1 values (null),(null),(null),(null); -alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i); -select * from t1; -i -1 -2 -3 -4 -drop table t1; -create table t1 (i int unsigned not null auto_increment primary key); alter table t1 rename t2; alter table t2 rename t1, add c char(10) comment "no comment"; show columns from t1; @@ -350,24 +380,3 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE t1 0 PRIMARY 2 User A 0 NULL NULL BTREE t1 1 Host 1 Host A NULL NULL NULL BTREE disabled DROP TABLE t1; -create table t1 (name char(15)); -insert into t1 (name) values ("current"); -create database mysqltest; -create table mysqltest.t1 (name char(15)); -insert into mysqltest.t1 (name) values ("mysqltest"); -select * from t1; -name -current -select * from mysqltest.t1; -name -mysqltest -alter table t1 rename mysqltest.t1; -Table 't1' already exists -select * from t1; -name -current -select * from mysqltest.t1; -name -mysqltest -drop table t1; -drop database mysqltest; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 21ea4fcc01f..9a29ab3c2d7 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -109,14 +109,14 @@ drop database mysqltest; # # Rights for renaming test (Bug #3270) # -connect (root,localhost,root,,test,0,mysql-master.sock); +connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); connection root; --disable_warnings create database mysqltest; --enable_warnings create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; -connect (user1,localhost,mysqltest_1,,mysqltest,0,mysql-master.sock); +connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); connection user1; -- error 1142 alter table t1 rename t2;