Bug #10479 | Invalid result in case of prepared statement with setLong | ||
---|---|---|---|
Submitted: | 9 May 2005 14:58 | Modified: | 9 May 2005 16:40 |
Reporter: | Vitaly Harisov | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 3.1.8 | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[9 May 2005 14:58]
Vitaly Harisov
[9 May 2005 15:00]
Vitaly Harisov
Test-case data
Attachment: MySQLBug.sql (application/octet-stream, text), 256 bytes.
[9 May 2005 15:01]
Vitaly Harisov
Test-case: Java class
Attachment: MySQLBug.java (application/octet-stream, text), 1.39 KiB.
[9 May 2005 16:40]
Mark Matthews
This is a server bug that's fixed in the most recent build from sources (and is probably a dupe of BUG#9777). The following demonstrates that is is fixed in what will be 4.1.12 (built from a pull from BitKeeper this morning), and that it is broken in 4.1.11: [mmatthew@localhost mysql-4.1]$ /usr/local/mysql/mysql-4.1/bin/mysql test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.1.12-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> prepare foo1 FROM "SELECT COUNT(a.f_a) FROM t_a a WHERE a.f_a>=1050003600000 AND a.f_a=1050003600000"; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> execute foo1; +--------------+ | COUNT(a.f_a) | +--------------+ | 1 | +--------------+ 1 row in set (0.01 sec) mysql> prepare foo2 FROM "SELECT COUNT(a.f_a) FROM t_a a WHERE a.f_a>=1050003600000 AND a.f_a=?"; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> set @foo_param_2=1050003600000; Query OK, 0 rows affected (0.00 sec) mysql> execute foo2 using @foo_param_2; +--------------+ | COUNT(a.f_a) | +--------------+ | 1 | +--------------+ 1 row in set (0.00 sec) mysql> (here's a session from MySQL-4.1.11) [mmatthew@localhost tmp]$ /usr/local/mysql/mysql-4.1/bin/mysql test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1150 to server version: 4.1.11-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> prepare foo1 FROM "SELECT COUNT(a.f_a) FROM t_a a WHERE a.f_a>=1050003600000 AND a.f_a=1050003600000"; Query OK, 0 rows affected (0.05 sec) Statement prepared mysql> execute foo1; +--------------+ | COUNT(a.f_a) | +--------------+ | 1 | +--------------+ 1 row in set (0.00 sec)