Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
488fe610
Commit
488fe610
authored
Mar 25, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated tests after merge
parent
ce79eb9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
33 deletions
+42
-33
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+40
-31
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+2
-2
No files found.
mysql-test/r/alter_table.result
View file @
488fe610
drop table if exists t1,t2;
drop table if exists t1,t2;
drop database if exists mysqltest;
create table t1 (
create table t1 (
col1 int not null auto_increment primary key,
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
col2 varchar(30) not null,
...
@@ -85,6 +86,45 @@ OPTIMIZE TABLE t1;
...
@@ -85,6 +86,45 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize status OK
DROP TABLE t1;
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,
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),
...
@@ -143,16 +183,6 @@ t1 1 n4 3 n2 A 10 NULL NULL YES BTREE
...
@@ -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
t1 1 n4 4 n3 A 10 NULL NULL YES BTREE
drop table t1;
drop table t1;
create table t1 (i int unsigned not null auto_increment primary key);
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 t1 rename t2;
alter table t2 rename t1, add c char(10) comment "no comment";
alter table t2 rename t1, add c char(10) comment "no comment";
show columns from t1;
show columns from t1;
...
@@ -350,24 +380,3 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE
...
@@ -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 0 PRIMARY 2 User A 0 NULL NULL BTREE
t1 1 Host 1 Host A NULL NULL NULL BTREE disabled
t1 1 Host 1 Host A NULL NULL NULL BTREE disabled
DROP TABLE t1;
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;
mysql-test/t/alter_table.test
View file @
488fe610
...
@@ -109,14 +109,14 @@ drop database mysqltest;
...
@@ -109,14 +109,14 @@ drop database mysqltest;
#
#
# Rights for renaming test (Bug #3270)
# 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
;
connection
root
;
--
disable_warnings
--
disable_warnings
create
database
mysqltest
;
create
database
mysqltest
;
--
enable_warnings
--
enable_warnings
create
table
mysqltest
.
t1
(
a
int
,
b
int
,
c
int
);
create
table
mysqltest
.
t1
(
a
int
,
b
int
,
c
int
);
grant
all
on
mysqltest
.
t1
to
mysqltest_1
@
localhost
;
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
;
connection
user1
;
--
error
1142
--
error
1142
alter
table
t1
rename
t2
;
alter
table
t1
rename
t2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment