Bug #20088 Query using ORs and NULLs doesn't return correct number of results
| Submitted: | 26 May 2006 8:38 | Modified: | 26 May 2006 12:33 |
|---|---|---|---|
| Reporter: | Taras Di | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 5.0.21-community-nt | OS: | Windows (windows 2000 v5.0 sp4) |
| Assigned to: | CPU Architecture: | Any |
[26 May 2006 8:38]
Taras Di
[26 May 2006 8:43]
Taras Di
Sorry, wrong severity level initially chosen
[26 May 2006 12:33]
MySQL Verification Team
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.
If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information
about accessing the source trees is available at
http://www.mysql.com/doc/en/Installing_source_tree.html
Additional info:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SELECT DISTINCT (personId),place FROM countries, people WHERE (people.place =
-> countries.locationId) OR (people.place IS NULL AND countries.locationId = 1);
+----------+-------+
| personId | place |
+----------+-------+
| 1 | 1 |
| 3 | NULL |
+----------+-------+
2 rows in set (0.02 sec)
mysql>
-----------------------------------------------------------------------------------
c:\mysql\bin>mysql -uroot test
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SELECT DISTINCT (personId),place FROM countries, people WHERE (people.place =
-> countries.locationId) OR (people.place IS NULL AND countries.locationId = 1);
+----------+-------+
| personId | place |
+----------+-------+
| 1 | 1 |
| 2 | 2 |
| 3 | NULL |
+----------+-------+
3 rows in set (0.00 sec)
mysql>
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.