~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/user_var.test

  • Committer: Patrick Crews
  • Date: 2011-01-29 14:17:35 UTC
  • mto: (2126.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2127.
  • Revision ID: gleebix@gmail.com-20110129141735-3y2658vt5ur0a33o
Fixes to make test-dbqp

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
drop table if exists t1,t2;
4
4
--enable_warnings
5
5
 
6
 
--error 1054
 
6
--error ER_BAD_FIELD_ERROR
7
7
set @a := foo;
8
8
set @a := connection_id() + 3;
9
9
select @a - connection_id();
77
77
drop table t1;
78
78
 
79
79
#
80
 
# Bug #2244: User variables didn't copy collation and derivation
81
 
# attributes from values they were initialized to.
82
 
#
83
 
 
84
 
set @a='test';
85
 
select collation(@a),coercibility(@a);
86
 
select @a='TEST';
87
 
select @a='TEST' collate utf8_bin;
88
 
 
89
 
set @a='test' collate utf8_general_ci;
90
 
select collation(@a),coercibility(@a);
91
 
select @a='TEST';
92
 
select @a='TEST' collate utf8_bin;
93
 
 
94
 
#
95
 
# Check the same invoking Item_set_user_var
96
 
#
97
 
select collation(@a:='test');
98
 
select coercibility(@a:='test');
99
 
select collation(@a:='test' collate utf8_bin);
100
 
select coercibility(@a:='test' collate utf8_bin);
101
 
select (@a:='test' collate utf8_bin) = 'TEST';
102
 
select collation(@a),coercibility(@a);
103
 
select (@a:='test' collate utf8_bin) = 'TEST' collate utf8_general_ci;
104
 
 
105
 
#
106
80
# Bug #6321 strange error:
107
81
#   string function FIELD(<uservariable content NULL>, ...)
108
82
#
110
84
select FIELD( @var,'1it','Hit') as my_column;
111
85
 
112
86
#
113
 
# Bug#9425 A user variable doesn't always have implicit coercibility
114
 
#
115
 
select @v, coercibility(@v);
116
 
set @v1=null, @v2=1, @v3=1.1, @v4=now();
117
 
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
118
 
 
119
 
#
120
87
# Bug #9286  SESSION/GLOBAL should be disallowed for user variables
121
88
#
122
 
--error 1064
 
89
--error ER_PARSE_ERROR
123
90
set session @honk=99;
124
91
 
125
92
#
152
119
show create table t1;
153
120
drop table t1;
154
121
 
155
 
# This is not supported by Drizzle
156
 
--error 1064
157
122
set @first_var= cast(NULL as integer);
158
 
#create table t1 select @first_var;
159
 
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
160
 
#show create table t1;
161
 
#drop table t1;
 
123
 
 
124
create table t1 select @first_var;
 
125
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
 
126
show create table t1;
 
127
drop table t1;
162
128
 
163
129
set @first_var= NULL;
164
130
create table t1 select @first_var;
188
154
# Second part, set user var from large number in table
189
155
# then select it
190
156
CREATE TABLE `bigfailure` (
191
 
  `afield` BIGINT NOT NULL
 
157
  `afield` BIGINT UNSIGNED NOT NULL
192
158
);
193
159
INSERT INTO `bigfailure` VALUES (18446744071710965857);
194
160
SELECT * FROM bigfailure;
226
192
#
227
193
# Bug#19024 - SHOW COUNT(*) WARNINGS not return Errors 
228
194
#
229
 
--error 1064
 
195
--error ER_PARSE_ERROR
230
196
insert into city 'blah';
231
197
SHOW COUNT(*) WARNINGS;
232
198
SHOW COUNT(*) ERRORS;