Bug #1444 | Query/Subquery not returning expected results | ||
---|---|---|---|
Submitted: | 30 Sep 2003 9:36 | Modified: | 23 Oct 2003 12:51 |
Reporter: | Matthew Yonkovit | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.0 | OS: | Linux (Red Hat 7.3, 2.4.18-3smp) |
Assigned to: | Oleksandr Byelkin | CPU Architecture: | Any |
[30 Sep 2003 9:36]
Matthew Yonkovit
[30 Sep 2003 11:41]
Indrek Siitan
On both of my test systems, this query produces the "wrong" results (including "Should Not Return") on the first run, and then no results on all following runs. mysql> SELECT dbid, name FROM taks_generator a, database_list b, task_list WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTER VAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') F ROM daily_task_list WHERE dbid = b.db_id AND taskid = a.taskgenid) , '1950-01- 01')) AND task_list.task_id = taskid; +------+-------------------+ | dbid | name | +------+-------------------+ | -1 | Valid | | -1 | Valid 2 | | -1 | Should Not Return | +------+-------------------+ 3 rows in set (0.00 sec) mysql> SELECT dbid, name FROM taks_generator a, database_list b, task_list WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM daily_task_list WHERE dbid = b.db_id AND taskid = a.taskgenid) , '1950-01-01')) AND task_list.task_id = taskid; Empty set (0.00 sec)
[16 Oct 2003 14:37]
Oleksandr Byelkin
ChangeSet 1.1609 03/10/17 00:36:01 bell@sanja.is.com.ua +5 -0 fixed support of used_tables() and const_item() in subqueries (BUG#1444)
[23 Oct 2003 12:51]
Oleksandr Byelkin
Thank You for bug report. Fix for this bug is pushed in source repository of mysql 4.1 and will be present in next relese.