~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
--disable_warnings
2
drop database if exists `mysqltest1`;
3
drop database if exists `mysqltest-1`;
4
drop database if exists `#mysql50#mysqltest-1`;
5
--enable_warnings
6
7
create database `mysqltest1`;
8
create database `#mysql50#mysqltest-1`;
9
create table `mysqltest1`.`t1` (a int);
10
create table `mysqltest1`.`#mysql50#t-1` (a int);
11
create table `#mysql50#mysqltest-1`.`t1` (a int);
12
create table `#mysql50#mysqltest-1`.`#mysql50#t-1` (a int);
13
show create database `mysqltest1`;
14
--error 1049
15
show create database `mysqltest-1`;
16
show create database `#mysql50#mysqltest-1`;
17
show tables in `mysqltest1`;
18
show tables in `#mysql50#mysqltest-1`;
19
20
--exec $MYSQL_CHECK --all-databases --fix-db-names --fix-table-names
21
22
show create database `mysqltest1`;
23
show create database `mysqltest-1`;
24
--error 1049
25
show create database `#mysql50#mysqltest-1`;
26
show tables in `mysqltest1`;
27
show tables in `mysqltest-1`;
28
drop database `mysqltest1`;
29
drop database `mysqltest-1`;
30
31
#
32
# Bug#17142: Crash if create with encoded name
33
#
34
--disable_warnings
35
drop table if exists `txu@0023p@0023p1`;
36
drop table if exists `txu#p#p1`;
37
--enable_warnings
38
create table `txu#p#p1` (s1 int);
39
insert into `txu#p#p1` values (1);
40
--error 1146
41
select * from `txu@0023p@0023p1`;
42
create table `txu@0023p@0023p1` (s1 int);
43
insert into `txu@0023p@0023p1` values (2);
44
select * from `txu@0023p@0023p1`;
45
select * from `txu#p#p1`;
46
drop table `txu@0023p@0023p1`;
47
drop table `txu#p#p1`;
48
49
#
50
# Check if old tables work
51
#
52
53
system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm;
54
truncate t1;
55
drop table t1;
56
57
#
58
# Bug#28360 (RENAME DATABASE destroys routines)
59
#
60
61
--disable_warnings
62
drop database if exists `tabc`;
63
drop database if exists `a-b-c`;
64
--enable_warnings
65
66
create database `tabc` default character set latin2;
67
create table tabc.t1 (a int);
68
FLUSH TABLES;
69
70
# Manually make a 5.0 database from the template
71
--mkdir $MYSQLTEST_VARDIR/master-data/a-b-c
72
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/db.opt $MYSQLTEST_VARDIR/master-data/a-b-c/db.opt
73
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.frm $MYSQLTEST_VARDIR/master-data/a-b-c/t1.frm
74
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYD $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYD
75
--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYI $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYI
76
77
show databases like '%a-b-c%';
78
ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
79
# The physical directory name is now a@002db@002dc, the logical name still a-b-c
80
show databases like '%a-b-c%';
81
show create database `a-b-c`;
82
show tables in `a-b-c`;
83
show create table `a-b-c`.`t1`;
84
drop database `a-b-c`;
85
drop database `tabc`;
86