~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/varbinary.test

  • Committer: Andy Lester
  • Date: 2008-08-10 02:15:48 UTC
  • mto: (266.1.31 use-replace-funcs)
  • mto: This revision was merged to the branch mainline in revision 295.
  • Revision ID: andy@petdance.com-20080810021548-0zx8nhzva6al10k3
Added a proper const qualifer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Initialise
2
 
--disable_warnings
3
 
drop table if exists t1;
4
 
--enable_warnings
5
 
 
6
 
#
7
 
# varbinary as string and number
8
 
#
9
 
 
10
 
select 0x31+1,concat(0x31)+1,-0xf;
11
 
select x'31',X'ffff'+0;
12
 
 
13
 
#
14
 
# Test of hex constants in WHERE:
15
 
#
16
 
 
17
 
create table t1 (ID int not null auto_increment,UNIQ bigint not null,primary key (ID),unique (UNIQ) );
18
 
insert into t1 set UNIQ=0x38afba1d73e6a18a;
19
 
insert into t1 set UNIQ=123; 
20
 
explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a;
21
 
drop table t1;
22
 
 
23
 
#
24
 
# Test error conditions
25
 
#
26
 
--error ER_PARSE_ERROR
27
 
select x'hello';
28
 
--error ER_BAD_FIELD_ERROR
29
 
select 0xfg;
30
 
 
31
 
#
32
 
# Test likely error conditions
33
 
#
34
 
create table t1 select 1 as x, 2 as xx;
35
 
select x,xx from t1;
36
 
drop table t1;
37
 
 
38
 
# End of 4.1 tests
39
 
 
40
 
 
41
 
# Check that the fix does not affect table created with current version
42
 
create table t1(a varbinary(255));
43
 
insert into t1 values("aaa   ");
44
 
select length(a) from t1;
45
 
alter table t1 modify a varchar(255);
46
 
select length(a) from t1;
47
 
drop table t1;
48
 
 
49
 
 
50
 
#
51
 
# Bug#28127 (Some valid identifiers names are not parsed correctly)
52
 
#
53
 
 
54
 
--disable_warnings
55
 
drop table if exists table_28127_a;
56
 
drop table if exists table_28127_b;
57
 
--enable_warnings
58
 
 
59
 
create table table_28127_a(0b02 int);
60
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
61
 
show create table table_28127_a;
62
 
 
63
 
create table table_28127_b(0b2 int);
64
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
65
 
show create table table_28127_b;
66
 
 
67
 
drop table table_28127_a;
68
 
drop table table_28127_b;
69