~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/user_var.result

  • Committer: Brian Aker
  • Date: 2010-10-20 20:26:18 UTC
  • mfrom: (1859.2.13 refactor)
  • Revision ID: brian@tangent.org-20101020202618-9222n39lm329urv5
Merge for Brian 

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;
172
172
) ENGINE=DEFAULT COLLATE = utf8_general_ci
173
173
drop table t1;
174
174
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;
 
175
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
176
set @first_var= NULL;
183
177
create table t1 select @first_var;
184
178
show create table t1;
185
179
Table   Create Table
186
180
t1      CREATE TABLE `t1` (
187
 
  `@first_var` BIGINT DEFAULT NULL
 
181
  `@first_var` BLOB
188
182
) ENGINE=DEFAULT COLLATE = utf8_general_ci
189
183
drop table t1;
190
184
set @first_var= concat(NULL);
209
203
@a
210
204
18446744071710965857
211
205
CREATE TABLE `bigfailure` (
212
 
`afield` BIGINT UNSIGNED NOT NULL
 
206
`afield` BIGINT NOT NULL
213
207
);
214
208
INSERT INTO `bigfailure` VALUES (18446744071710965857);
215
209
SELECT * FROM bigfailure;
232
226
SET @a := (SELECT afield FROM bigfailure);
233
227
SELECT @a;
234
228
@a
235
 
18446744071710965857
 
229
-1998585759
236
230
SET @a := (select afield from (SELECT afield FROM bigfailure) as b);
237
231
SELECT @a;
238
232
@a
239
 
18446744071710965857
 
233
-1998585759
240
234
SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure));
241
235
SELECT @a;
242
236
@a
243
 
18446744071710965857
 
237
-1998585759
244
238
drop table bigfailure;
245
239
create table t1(f1 int, f2 int);
246
240
insert into t1 values (1,2),(2,3),(3,1);