~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
# This test uses chmod, can't be run with root permissions
2
-- source include/not_as_root.inc
3
4
5
# Initialise
6
--disable_warnings
7
drop table if exists t1;
8
--enable_warnings
9
10
#
11
# varbinary as string and number
12
#
13
14
select 0x31+1,concat(0x31)+1,-0xf;
15
select x'31',X'ffff'+0;
16
17
#
18
# Test of hex constants in WHERE:
19
#
20
642.1.47 by Lee
add varbinary test
21
create table t1 (ID int not null auto_increment,UNIQ bigint not null,primary key (ID),unique (UNIQ) );
1 by brian
clean slate
22
insert into t1 set UNIQ=0x38afba1d73e6a18a;
23
insert into t1 set UNIQ=123; 
24
explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a;
25
drop table t1;
26
27
#
28
# Test error conditions
29
#
30
--error 1064
31
select x'hello';
32
--error 1054
33
select 0xfg;
34
35
#
36
# Test likely error conditions
37
#
38
create table t1 select 1 as x, 2 as xx;
39
select x,xx from t1;
40
drop table t1;
41
42
# End of 4.1 tests
43
44
#
45
# Bug #19371 VARBINARY() have trailing zeros after upgrade from 4.1
46
#
47
642.1.49 by Lee
enable type_enum, union, variables-big and type_enum tests
48
# MySQL file formats are not compatible with Drizzle
1 by brian
clean slate
49
# Test with a saved table from 4.1
642.1.49 by Lee
enable type_enum, union, variables-big and type_enum tests
50
copy_file std_data/bug19371.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm;
51
chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.frm;
52
copy_file std_data/bug19371.MYD $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
53
chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYD;
54
copy_file std_data/bug19371.MYI $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
55
chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
56
--error 1033
57
show create table t1;
58
drop table t1;
1 by brian
clean slate
59
60
# Check that the fix does not affect table created with current version
61
create table t1(a varbinary(255));
62
insert into t1 values("aaa   ");
63
select length(a) from t1;
64
alter table t1 modify a varchar(255);
65
select length(a) from t1;
66
drop table t1;
67
68
69
#
70
# Bug#28127 (Some valid identifiers names are not parsed correctly)
71
#
72
73
--disable_warnings
74
drop table if exists table_28127_a;
75
drop table if exists table_28127_b;
76
--enable_warnings
77
78
create table table_28127_a(0b02 int);
79
show create table table_28127_a;
80
81
create table table_28127_b(0b2 int);
82
show create table table_28127_b;
83
84
drop table table_28127_a;
85
drop table table_28127_b;
86