Bug #31000 | Left join using stored function fails with corrupted result | ||
---|---|---|---|
Submitted: | 13 Sep 2007 12:52 | Modified: | 29 Oct 2009 16:53 |
Reporter: | Zigmund Bulinsh | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | 5.0.45 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[13 Sep 2007 12:52]
Zigmund Bulinsh
[13 Sep 2007 13:18]
Zigmund Bulinsh
some mistake in title of report
[13 Sep 2007 13:56]
MySQL Verification Team
Thank you for the bug report. I can't repeat with server from current source server: c:\dev\5.0>bin\mysql -uroot -N test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.0.50-nt Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select -> A.id, -> A.name, -> if(A.id = 4, 4, 1), -> Func(A.id), -> (select GROUP_CONCAT(value) from detail where main_id = Func(A.id)), -> (select MAX(value) from detail where main_id = Func(A.id)), -> MAX(B.value) -> from -> main A -> left join detail B -> on B.main_id = Func(A.id) -> group by -> A.id, A.name; +---+--------+---+------+------+------+------+ | 1 | First | 1 | 1 | 1 | 1 | 1 | | 2 | Second | 1 | 1 | 1 | 1 | 1 | | 3 | Third | 1 | 1 | 1 | 1 | 1 | | 4 | Fourth | 4 | 4 | 0 | 0 | 0 | +---+--------+---+------+------+------+------+ 4 rows in set (0.01 sec) mysql> select -> A.id, -> A.name, -> if(A.id = 4, 4, 1), -> Func(A.id), -> (select GROUP_CONCAT(value) from detail where main_id = Func(A.id)), -> (select MAX(value) from detail where main_id = Func(A.id)), -> MAX(B.value) -> from -> main A -> left join detail B -> on B.main_id = if(A.id = 4, 4, 1) -> #comment this Func(A.id) -> group by -> A.id, A.name; +---+--------+---+------+------+------+------+ | 1 | First | 1 | 1 | 1 | 1 | 1 | | 2 | Second | 1 | 1 | 1 | 1 | 1 | | 3 | Third | 1 | 1 | 1 | 1 | 1 | | 4 | Fourth | 4 | 4 | 0 | 0 | 0 | +---+--------+---+------+------+------+------+ 4 rows in set (0.01 sec) mysql>
[13 Sep 2007 14:09]
Zigmund Bulinsh
Sorry, but I have no access to 5.0.50 community edition version! How I can fix this asap?
[13 Sep 2007 14:16]
Zigmund Bulinsh
Maybe it is some case of Bug#29604... When I can get 5.0.50 on which it works..?
[13 Sep 2007 14:28]
Zigmund Bulinsh
This can be repeated on 4 mysql server 5.0.45 versions! As with turned on query cache and also without.
[13 Sep 2007 15:08]
Zigmund Bulinsh
This works for some time. Waiting for new release... select A.id, A.name, if(A.id = 4, 4, 1), Func(A.id), (select GROUP_CONCAT(value) from detail where main_id = Func(A.id)), (select MAX(value) from detail where main_id = Func(A.id)), MAX(B.value) from main A left join detail B on B.main_id = if(A.id = 0, 0, Func(A.id)) group by A.id, A.name
[29 Oct 2009 16:53]
Zigmund Bulinsh
It works on 5.1.40. I just tested. So we close the issue.