symlink.result 4.74 KB
Newer Older
1
drop table if exists t1,t2,t7,t8,t9;
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
2
drop database if exists mysqltest;
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a));
create table t2 (a int not null auto_increment, b char(16) not null, primary key (a));
insert into t1 (b) values ("test"),("test1"),("test2"),("test3");
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
drop table t2;
insert into t9 select * from t1;
check table t9;
27 28
Table	Op	Msg_type	Msg_text
test.t9	check	status	OK
29
optimize table t9;
30 31
Table	Op	Msg_type	Msg_text
test.t9	optimize	status	OK
32
repair table t9;
33 34
Table	Op	Msg_type	Msg_text
test.t9	repair	status	OK
35 36
alter table t9 add column c int not null;
show create table t9;
37 38
Table	Create Table
t9	CREATE TABLE `t9` (
39
  `a` int(11) NOT NULL AUTO_INCREMENT,
40 41
  `b` char(16) NOT NULL,
  `c` int(11) NOT NULL,
42
  PRIMARY KEY (`a`)
43
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
44 45 46 47
alter table t9 rename t8, add column d int not null;
alter table t8 rename t7;
rename table t7 to t9;
drop table t1;
48 49 50
SHOW CREATE TABLE t9;
Table	Create Table
t9	CREATE TABLE `t9` (
51
  `a` int(11) NOT NULL AUTO_INCREMENT,
52 53 54
  `b` char(16) NOT NULL,
  `c` int(11) NOT NULL,
  `d` int(11) NOT NULL,
55
  PRIMARY KEY (`a`)
56
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
57 58 59 60 61
Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
62 63
alter table t9 rename mysqltest.t9;
select count(*) from mysqltest.t9;
64 65
count(*)
16724
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
66
show create table mysqltest.t9;
67 68
Table	Create Table
t9	CREATE TABLE `t9` (
69
  `a` int(11) NOT NULL AUTO_INCREMENT,
70 71 72
  `b` char(16) NOT NULL,
  `c` int(11) NOT NULL,
  `d` int(11) NOT NULL,
73
  PRIMARY KEY (`a`)
74
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
75
drop database mysqltest;
76
create table t1 (a int not null) engine=myisam;
77 78
Warnings:
Warning	0	DATA DIRECTORY option ignored
79 80 81
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
82
  `a` int(11) NOT NULL
monty@mysql.com's avatar
monty@mysql.com committed
83
) ENGINE=MyISAM DEFAULT CHARSET=latin1
84
alter table t1 add b int;
85 86
Warnings:
Warning	0	DATA DIRECTORY option ignored
87 88 89
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
90
  `a` int(11) NOT NULL,
91
  `b` int(11) DEFAULT NULL
monty@mysql.com's avatar
monty@mysql.com committed
92
) ENGINE=MyISAM DEFAULT CHARSET=latin1
93 94
Warnings:
Warning	0	INDEX DIRECTORY option ignored
95 96 97
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
98
  `a` int(11) NOT NULL,
99
  `b` int(11) DEFAULT NULL
monty@mysql.com's avatar
monty@mysql.com committed
100
) ENGINE=MyISAM DEFAULT CHARSET=latin1
101
drop table t1;
102
CREATE TABLE t1(a INT)
103 104
DATA DIRECTORY='TEST_DIR/master-data/mysql'
INDEX DIRECTORY='TEST_DIR/master-data/mysql';
105
RENAME TABLE t1 TO user;
106
ERROR HY000: Can't create/write to file 'TEST_DIR/master-data/mysql/user.MYI' (Errcode: 17)
107
DROP TABLE t1;
108 109 110
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
111
  `i` int(11) DEFAULT NULL
112 113 114 115 116
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
117
  `i` int(11) DEFAULT NULL
118 119
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
120 121 122
show create table t1;
Table	Create Table
t1	CREATE TEMPORARY TABLE `t1` (
123
  `a` int(11) DEFAULT NULL
124
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
125 126 127
show create table t1;
Table	Create Table
t1	CREATE TEMPORARY TABLE `t1` (
128
  `a` int(11) DEFAULT NULL
129
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
130 131 132 133 134 135 136 137 138 139 140
create table t1 (a int) engine=myisam select 42 a;
select * from t1;
a
9
select * from t1;
a
99
select * from t1;
a
42
drop table t1;
141
End of 4.1 tests
142 143 144 145 146 147 148 149 150 151 152
CREATE DATABASE db1;
CREATE DATABASE db2;
USE db2;
INSERT INTO db2.t1 VALUES (1);
SELECT * FROM db2.t1;
b
1
RESET QUERY CACHE;
USE db1;
SET SESSION keep_files_on_create = TRUE;
CREATE TABLE t1 (a INT) ENGINE MYISAM;
153
Got one of the listed errors
154 155 156 157 158 159 160 161 162 163
CREATE TABLE t3 (a INT) Engine=MyISAM;
INSERT INTO t3 VALUES (1),(2),(3);
TRUNCATE TABLE t3;
SELECT * from t3;
a
SET SESSION keep_files_on_create = DEFAULT;
DROP TABLE db2.t1, db1.t3;
DROP DATABASE db1;
DROP DATABASE db2;
USE test;
164
End of 5.0 tests