Bug #20433 mysqltest generates output inconsistent with the mysql client.
Submitted: 13 Jun 2006 16:41 Modified: 16 Jun 2006 14:04
Reporter: Iggy Galarza Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.0.23 OS:Linux (Linux)
Assigned to: Sveta Smirnova CPU Architecture:Any

[13 Jun 2006 16:41] Iggy Galarza
Description:
For some SQL statements, the mysql client and mysqltest application return different results.  For example, the statements:

SET @v = 0; SELECT @v AS pre, @v := @v + 1 AS op, @v AS post FROM t1

produces the following in mysqltest

 pre   op      pos
 0     1       0
 0     2       0
 0     3       0

but produces the following in mysql client

 +------+------+------+
 | pre  | op   | pos  |
 +------+------+------+
 | 0    |    1 | 1    |
 | 1    |    2 | 2    |
 | 2    |    3 | 3    |
 +------+------+------+

How to repeat:
Issue the following statements first in the mysql client and then using mysqltest.
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (3), (1), (2);
SET @v = 0; SELECT @v AS pre, @v := @v + 1 AS op, @v AS pos FROM t1;

Suggested fix:
Both mysqltest and the mysql client application should return the same results. 
The mysql client is correct.