On 31-Aug-2001 Jeremiah T. Folsom-Kovarik wrote:
> Weird things have just started happening in at least one table of my MySQL
> 3.22.32 database. The symptoms are like this:
>
> mysql> describe orders;
> +--------------+----------------------+------+-----+---------+-------+
>| Field | Type | Null | Key | Default | Extra |
> +--------------+----------------------+------+-----+---------+-------+
> ...
>| contact_info | smallint(5) unsigned | YES | | NULL | |
>| expired | datetime | YES | | NULL | |
> +--------------+----------------------+------+-----+---------+-------+
>
> mysql> select contact_info, expired from orders where order_num = '1';
> +--------------+---------+
>| contact_info | expired |
> +--------------+---------+
>| NULL | NULL |
> +--------------+---------+
^^^^^^^^ ^^^^^^
this is NULL this is 'NULL', the string.
> 1 row in set (0.00 sec)
>
> mysql> select count(*) from orders where contact_info is null;
> +----------+
>| count(*) |
> +----------+
>| 248 |
> +----------+
> 1 row in set (0.02 sec)
>
> // here comes the problematic part //
>
> mysql> select count(*) from orders where expired is null;
> +----------+
>| count(*) |
> +----------+
>| 0 |
> +----------+
> 1 row in set (0.00 sec)
>
> Obviously this last result is wrong; there should be at least one (and in
> fact about thirty) table entries where expired is null. The thing can select
> on and update the 'expired' field, and can show rows where 'expired' is null
> if I select on another key, but can't seem to find those same rows when I
> try to select them by the 'expired' field. Only that one field is giving me
> trouble, and this just started happening today.
>
> I've tried 'isamchk -r orders' to no avail, and I found nothing else that
> might do this in the manual or archives.. I can send more info to anybody
> that wants it, but does anybody recognize these symptoms right off or know
> what might be causing them?
>
Check :
select * from orders where expired='NULL';
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php