~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/user_var.result

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
2       1       0       0       1
24
24
explain select * from t1 where i=@vv1;
25
25
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
26
 
1       SIMPLE  t1      ref     i       i       4       const   2       
 
26
1       SIMPLE  t1      ref     i       i       4       const   1       
27
27
select @vv1,i,v from t1 where i=@vv1;
28
28
@vv1    i       v
29
29
1       1       1
36
36
1       SIMPLE  t1      index   NULL    i       4       NULL    3       Using where; Using index
37
37
explain select * from t1 where i=@vv1;
38
38
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
39
 
1       SIMPLE  t1      ref     i       i       4       const   2       
 
39
1       SIMPLE  t1      ref     i       i       4       const   1       
40
40
drop table t1,t2;
41
41
set @a=0,@b=0;
42
42
select @a:=10,   @b:=1,   @a > @b, @a < @b;
135
135
hello again     hello   hello again     3       hello again     hello again
136
136
hello again     hello   hello again     3       hello again     hello again
137
137
drop table t1;
 
138
set @a='test';
 
139
select collation(@a),coercibility(@a);
 
140
collation(@a)   coercibility(@a)
 
141
utf8_general_ci 2
 
142
select @a='TEST';
 
143
@a='TEST'
 
144
1
 
145
select @a='TEST' collate utf8_bin;
 
146
@a='TEST' collate utf8_bin
 
147
0
 
148
set @a='test' collate utf8_general_ci;
 
149
select collation(@a),coercibility(@a);
 
150
collation(@a)   coercibility(@a)
 
151
utf8_general_ci 2
 
152
select @a='TEST';
 
153
@a='TEST'
 
154
1
 
155
select @a='TEST' collate utf8_bin;
 
156
@a='TEST' collate utf8_bin
 
157
0
 
158
select collation(@a:='test');
 
159
collation(@a:='test')
 
160
utf8_general_ci
 
161
select coercibility(@a:='test');
 
162
coercibility(@a:='test')
 
163
2
 
164
select collation(@a:='test' collate utf8_bin);
 
165
collation(@a:='test' collate utf8_bin)
 
166
utf8_bin
 
167
select coercibility(@a:='test' collate utf8_bin);
 
168
coercibility(@a:='test' collate utf8_bin)
 
169
2
 
170
select (@a:='test' collate utf8_bin) = 'TEST';
 
171
(@a:='test' collate utf8_bin) = 'TEST'
 
172
0
 
173
select collation(@a),coercibility(@a);
 
174
collation(@a)   coercibility(@a)
 
175
utf8_bin        2
 
176
select (@a:='test' collate utf8_bin) = 'TEST' collate utf8_general_ci;
 
177
(@a:='test' collate utf8_bin) = 'TEST' collate utf8_general_ci
 
178
1
138
179
set @var= NULL ;
139
180
select FIELD( @var,'1it','Hit') as my_column;
140
181
my_column
141
182
0
 
183
select @v, coercibility(@v);
 
184
@v      coercibility(@v)
 
185
NULL    2
 
186
set @v1=null, @v2=1, @v3=1.1, @v4=now();
 
187
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
 
188
coercibility(@v1)       coercibility(@v2)       coercibility(@v3)       coercibility(@v4)
 
189
2       2       2       2
142
190
set session @honk=99;
143
191
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '@honk=99' at line 1
144
192
select @@local.max_allowed_packet;
168
216
show create table t1;
169
217
Table   Create Table
170
218
t1      CREATE TABLE `t1` (
171
 
  `@first_var` BLOB
172
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
219
  `@first_var` blob
 
220
) ENGINE=DEFAULT
173
221
drop table t1;
174
222
set @first_var= cast(NULL as integer);
175
 
create table t1 select @first_var;
176
 
show create table t1;
177
 
Table   Create Table
178
 
t1      CREATE TABLE `t1` (
179
 
  `@first_var` BIGINT DEFAULT NULL
180
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
181
 
drop table t1;
 
223
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'integer)' at line 1
182
224
set @first_var= NULL;
183
225
create table t1 select @first_var;
184
226
show create table t1;
185
227
Table   Create Table
186
228
t1      CREATE TABLE `t1` (
187
 
  `@first_var` BIGINT DEFAULT NULL
188
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
229
  `@first_var` blob
 
230
) ENGINE=DEFAULT
189
231
drop table t1;
190
232
set @first_var= concat(NULL);
191
233
create table t1 select @first_var;
192
234
show create table t1;
193
235
Table   Create Table
194
236
t1      CREATE TABLE `t1` (
195
 
  `@first_var` BLOB
196
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
237
  `@first_var` blob
 
238
) ENGINE=DEFAULT
197
239
drop table t1;
198
240
set @first_var=1;
199
241
set @first_var= cast(NULL as CHAR);
201
243
show create table t1;
202
244
Table   Create Table
203
245
t1      CREATE TABLE `t1` (
204
 
  `@first_var` TEXT COLLATE utf8_general_ci
205
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
246
  `@first_var` text
 
247
) ENGINE=DEFAULT
206
248
drop table t1;
207
249
set @a=18446744071710965857;
208
250
select @a;
209
251
@a
210
252
18446744071710965857
211
253
CREATE TABLE `bigfailure` (
212
 
`afield` BIGINT UNSIGNED NOT NULL
 
254
`afield` BIGINT NOT NULL
213
255
);
214
256
INSERT INTO `bigfailure` VALUES (18446744071710965857);
215
257
SELECT * FROM bigfailure;
232
274
SET @a := (SELECT afield FROM bigfailure);
233
275
SELECT @a;
234
276
@a
235
 
18446744071710965857
 
277
-1998585759
236
278
SET @a := (select afield from (SELECT afield FROM bigfailure) as b);
237
279
SELECT @a;
238
280
@a
239
 
18446744071710965857
 
281
-1998585759
240
282
SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure));
241
283
SELECT @a;
242
284
@a
243
 
18446744071710965857
 
285
-1998585759
244
286
drop table bigfailure;
245
287
create table t1(f1 int, f2 int);
246
288
insert into t1 values (1,2),(2,3),(3,1);