Re: Simple query returns inconsistent results when using "=" operator

[email protected] Sat, 29 Nov 2008 04:57:41 -0500
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Thomas,

It looks to me like it's behaving as though some portion of your =20
upgrade has introduced trailing spaces or non-printable characters. It =20
might be useful to whoever ends up looking at this, if you were to =20
report the behavior of your query using left and trim (or rtrim) =20
respectively.

If one or both of those brings back your expected result set, again it =20
might be helpful to check the output data file to see if it was =20
introduced when outputting the data to the disk or on the latter input.

OTOH, if you just send them your files, the programmer will surely do =20
the same check. This might be most useful if you're in a terrible =20
hurry and are looking for a work-around.

-carol stone



Quoting Thomas Klettke <[email protected]>:

> Scenario: Moved from MySQL 4.1.9-0 (Fedora Core 2) to MySQL 5.0.45-7.el5
> (CentOS 5.2)
>
> Noticed that basic queries yield inconsistent results:
>
> Query 1:
>
> mysql> select contact_id,system_message from contact_comments where
> contact_id=3D168676;
> +------------+----------------+
> | contact_id | system_message |
> +------------+----------------+
> |     168676 | no             |
> |     168676 | yes            |
> |     168676 | no             |
> |     168676 | yes            |
> |     168676 | no             |
> |     168676 | yes            |
> +------------+----------------+
> 6 rows in set (0.00 sec)
>
> Query 2:
> mysql> select contact_id,system_message from contact_comments where
> contact_id=3D168676 and system_message=3D'no';
> Empty set (0.00 sec)
>
> I would expect that this should have resulted in 3 rows.
>
> Query 3:
> mysql> select contact_id,system_message from contact_comments where
> contact_id=3D168676 and system_message=3D'yes';
> Empty set (0.00 sec)


-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]