~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/t/user_var.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
328
328
INSERT INTO t1 VALUES (1);
329
329
DROP TABLE t1;
330
330
 
 
331
#
 
332
# Bug #55615: debug assertion after using variable in assignment and
 
333
# referred to
 
334
# Bug #55564: crash with user variables, assignments, joins...
 
335
#
 
336
 
 
337
CREATE TABLE t1(a INT);
 
338
INSERT INTO t1 VALUES (0),(0);
 
339
--echo # BUG#55615 : should not crash
 
340
SELECT (@a:=(SELECT @a:=1 FROM t1 LIMIT 1)) AND COUNT(1) FROM t1 GROUP BY @a;
 
341
--echo # BUG#55564 : should not crash
 
342
SELECT IF(
 
343
  @v:=LEAST((SELECT 1 FROM t1 t2 LEFT JOIN t1 ON (@v) GROUP BY t1.a), a),
 
344
  count(*), 1) 
 
345
FROM t1 GROUP BY a LIMIT 1;
 
346
 
 
347
DROP TABLE t1;
 
348
 
 
349
#
 
350
# BUG#56138 "valgrind errors about overlapping memory when
 
351
# double-assigning same variable"
 
352
#
 
353
 
 
354
select @v:=@v:=sum(1) from dual;
 
355
 
 
356
#
 
357
# Bug #57187: more user variable fun with multiple assignments and
 
358
#             comparison in query
 
359
#
 
360
 
 
361
CREATE TABLE t1(a DECIMAL(31,21));
 
362
INSERT INTO t1 VALUES (0);
 
363
 
 
364
SELECT (@v:=a) <> (@v:=1) FROM t1;
 
365
 
 
366
DROP TABLE t1;
 
367
 
331
368
--echo End of 5.1 tests