Bug #5873 | User variables don't work after FROM when using JConnector | ||
---|---|---|---|
Submitted: | 4 Oct 2004 9:14 | Modified: | 4 Oct 2004 14:09 |
Reporter: | Tony Bosco | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / J | Severity: | S1 (Critical) |
Version: | 3.0.14 | OS: | Windows (WIndows 2000) |
Assigned to: | Mark Matthews | CPU Architecture: | Any |
[4 Oct 2004 9:14]
Tony Bosco
[4 Oct 2004 14:09]
Mark Matthews
I'm not able to repeat the behavior where you say this works in the command-line client...are you sure you don't have the user variable defined on the connection's session already (notice the following warning from the docs at http://dev.mysql.com/doc/mysql/en/Variables.html "The general rule is to never assign and use the same variable in the same statement.")? mysql> SELECT @location:=4, field2 FROM testBug5873 WHERE testBug5873.field1 BET WEEN @location AND 8; Empty set (0.00 sec) mysql> select * from testBug5873; +--------+---------+ | field1 | field2 | +--------+---------+ | 5 | abcdefg | +--------+---------+ 1 row in set (0.01 sec) mysql> SELECT @location:=4, field2 FROM testBug5873 WHERE testBug5873.field1 BET WEEN @location AND 8; +--------------+---------+ | @location:=4 | field2 | +--------------+---------+ | 4 | abcdefg | +--------------+---------+ 1 row in set (0.00 sec)