Hi,
(tested with 3.23, 4.0.9 and 4.1)
how-to-repeat:
mysql> create table a (a int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into a values (1),(2),(3),(4),(5);
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> set @a:=1;
Query OK, 0 rows affected (0.00 sec)
mysql> select @a:=a from a where @a = 1000;
+-------+
| @a:=a |
+-------+
| 1 |
| 2 |
| 3 |
| 4 |
+-------+
4 rows in set (0.00 sec)
mysql> select @a:=a from a where @a <> 1000;
+-------+
| @a:=a |
+-------+
| 1 |
| 2 |
| 3 |
| 4 |
+-------+
4 rows in set (0.00 sec)
Why does WHERE Clause always return true?!
Regards
Georg
P.S: Another sample, http://www.sc-leinfelden.de/mysql/t186.html works well