Commit 3c5602fa authored by jimw@mysql.com's avatar jimw@mysql.com

Re-enable alter_table test for embedded server by moving grant-related test

to grant.test and using replace_column to neuter the Privileges column in
SHOW FULL COLUMNS.
parent 84513973
...@@ -1506,7 +1506,6 @@ run_testcase () ...@@ -1506,7 +1506,6 @@ run_testcase ()
# script soon anyway so it is not worth it spending the time # script soon anyway so it is not worth it spending the time
if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then
for t in \ for t in \
"alter_table" \
"bdb-deadlock" \ "bdb-deadlock" \
"connect" \ "connect" \
"ctype_latin1_de" \ "ctype_latin1_de" \
......
...@@ -52,9 +52,9 @@ KEY NAME (NAME)); ...@@ -52,9 +52,9 @@ KEY NAME (NAME));
ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null; ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
SHOW FULL COLUMNS FROM t1; SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment Field Type Collation Null Key Default Extra Privileges Comment
GROUP_ID int(10) unsigned NULL PRI 0 select,insert,update,references GROUP_ID int(10) unsigned NULL PRI 0 #
LANG_ID smallint(5) unsigned NULL PRI 0 select,insert,update,references LANG_ID smallint(5) unsigned NULL PRI 0 #
NAME char(80) latin1_swedish_ci MUL select,insert,update,references NAME char(80) latin1_swedish_ci MUL #
DROP TABLE t1; DROP TABLE t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values(9),(3),(12),(10); insert into t1 values(9),(3),(12),(10);
...@@ -117,14 +117,6 @@ name ...@@ -117,14 +117,6 @@ name
mysqltest mysqltest
drop table t1; drop table t1;
drop database mysqltest; 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;
ERROR 42000: INSERT,CREATE 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=_binary'mysqltest_1';
drop database mysqltest;
create table t1 (n1 int not null, n2 int, n3 int, n4 float, create table t1 (n1 int not null, n2 int, n3 int, n4 float,
unique(n1), unique(n1),
key (n1, n2, n3, n4), key (n1, n2, n3, n4),
......
This diff is collapsed.
...@@ -427,3 +427,11 @@ delete from mysql.columns_priv where user="mysqltest_3"; ...@@ -427,3 +427,11 @@ delete from mysql.columns_priv where user="mysqltest_3";
flush privileges; flush privileges;
drop database mysqltest_1; drop database mysqltest_1;
drop database mysqltest_2; drop database mysqltest_2;
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;
ERROR 42000: INSERT,CREATE 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=_binary'mysqltest_1';
drop database mysqltest;
...@@ -41,6 +41,7 @@ PRIMARY KEY (GROUP_ID,LANG_ID), ...@@ -41,6 +41,7 @@ PRIMARY KEY (GROUP_ID,LANG_ID),
KEY NAME (NAME)); KEY NAME (NAME));
#show table status like "t1"; #show table status like "t1";
ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null; ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
--replace_column 8 #
SHOW FULL COLUMNS FROM t1; SHOW FULL COLUMNS FROM t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -107,25 +108,6 @@ select * from mysqltest.t1; ...@@ -107,25 +108,6 @@ select * from mysqltest.t1;
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
#
# Rights for renaming test (Bug #3270)
#
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
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,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
alter table t1 rename t2;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
# #
# ALTER TABLE ... ENABLE/DISABLE KEYS # ALTER TABLE ... ENABLE/DISABLE KEYS
......
...@@ -369,3 +369,23 @@ delete from mysql.columns_priv where user="mysqltest_3"; ...@@ -369,3 +369,23 @@ delete from mysql.columns_priv where user="mysqltest_3";
flush privileges; flush privileges;
drop database mysqltest_1; drop database mysqltest_1;
drop database mysqltest_2; drop database mysqltest_2;
#
# Rights for renaming test (Bug #3270)
#
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
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,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
alter table t1 rename t2;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment