NOT LIKE error

------_=_NextPart_001_01C339F8.A7D8D7F6
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Not sure if this is a bug, but couldn't find any documentation to
explain it - I'm guessing it's standard
SQL for the version I'm on ? (4.0.13)

The 'problem' is that it doesn't return the NULL row with the NOT LIKE
statement.


mysql> describe test_like;
+---------+---------+------+-----+---------+---------------- +
| Field | Type | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+---------------- +
| test_id | int(11) | | PRI | NULL | auto_increment |
| name | text | YES | | NULL | |
+---------+---------+------+-----+---------+---------------- +
2 rows in set (0.00 sec)

mysql> select * from test_like;
+---------+-------+
| test_id | name |
+---------+-------+
| 1 | one |
| 2 | two |
| 3 | NULL |
| 4 | three |
+---------+-------+
4 rows in set (0.00 sec)

mysql> select * from test_like where name not like '%o%';
+---------+-------+
| test_id | name |
+---------+-------+
| 4 | three |
+---------+-------+
1 row in set (0.00 sec)


________________________________

ICT Helpdesk: 8939 7116

________________________________

ICT Helpdesk: 8939 7116


------_=_NextPart_001_01C339F8.A7D8D7F6--
Rohan Hawthorne [ Di, 24 Juni 2003 04:31 ] [ ID #75919 ]

Re: NOT LIKE error

Rohan,

Please don't ask such type of questions here. This list is dedicated to Bug
reports with repeatable test cases.

Rohan Hawthorne wrote:
<cut>

> The 'problem' is that it doesn't return the NULL row with the NOT LIKE
> statement.

This is how NULL is defined in theory and standard.
NULL has meaning of "unknown" therefore it can't be compared with =, !=, <, >,
LIKE because result is always unknown.

<cut>

Best regards

--
Are you MySQL certified? -> http://www.mysql.com/certification
For technical support contracts, visit https://order.mysql.com/?ref=msal
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexander Keremidarski <salle [at] mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
<___/ www.mysql.com




--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Alexander Keremidarsk[1] [ Di, 24 Juni 2003 09:26 ] [ ID #75920 ]
Datenbanken » gmane.comp.db.mysql.bugs » NOT LIKE error

Vorheriges Thema: Newer Versions of MySQL cannot RESTORE tables BACKUP'ed with older ones
Nächstes Thema: Case (in)sensitive