Bug #8817 | coalesce() with max() or count() in stored proc. does not work next time | ||
---|---|---|---|
Submitted: | 26 Feb 2005 0:26 | Modified: | 26 Feb 2005 1:14 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.2-alpha-max-log | OS: | Windows (WinXp Professional) |
Assigned to: | CPU Architecture: | Any |
[26 Feb 2005 0:26]
[ name withheld ]
[26 Feb 2005 1:14]
MySQL Verification Team
This was already fixed in the current BK source. Thank you for the bug report: C:\mysql\bin>mysql -uroot test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.3-alpha-pro Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table t1(id int,name varchar(5)); Query OK, 0 rows affected (0.15 sec) mysql> insert into t1 values(1,'dfdfsdf'); Query OK, 1 row affected, 1 warning (0.06 sec) mysql> insert into t1 values(2,'aaaa') -> ; Query OK, 1 row affected (0.00 sec) mysql> DELIMITER $$ mysql> mysql> DROP PROCEDURE IF EXISTS test_coalesce$$ Query OK, 0 rows affected, 1 warning (0.02 sec) mysql> CREATE PROCEDURE test_coalesce() -> SQL SECURITY INVOKER -> begin -> declare maxOrder int; -> SELECT -> coalesce(count(id),0)+1 INTO maxOrder -> FROM -> t1; -> select maxOrder; -> end$$ Query OK, 0 rows affected (0.03 sec) mysql> mysql> DELIMITER ; mysql> call test_coalesce(); +----------+ | maxOrder | +----------+ | 3 | +----------+ 1 row in set (0.02 sec) Query OK, 0 rows affected (0.02 sec) mysql> call test_coalesce(); +----------+ | maxOrder | +----------+ | 3 | +----------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql> call test_coalesce(); +----------+ | maxOrder | +----------+ | 3 | +----------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql>