Bug #53209 Inconsistent results returned from query
Submitted: 27 Apr 2010 15:36 Modified: 27 May 2010 17:05
Reporter: Royce Souther Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:4.1.11 OS:Linux (Debian 3)
Assigned to: CPU Architecture:Any
Tags: white space inconsistency issue

[27 Apr 2010 15:36] Royce Souther
Description:
I found this odd thing happening in some results I get back from MySQL. I am doing a SELECT MAX on the unique integer index field of two tables and in the SELECT I am adding one so that I can get the next available index number. One one table it seems to be white space sensitive and on the other it is not.

mysql> SELECT MAX(mid) FROM mailbox;
+----------+
| MAX(mid) |
+----------+
|  2199650 |             <-------------- That is correct.
+----------+

mysql> SELECT MAX(mid)+1 FROM mailbox;
+------------+
| MAX(mid)+1 |
+------------+
|    2199651 |             <-------------- That is correct.
+------------+

mysql> SELECT MAX(mid) + 1 FROM mailbox;
+--------------+
| MAX(mid) + 1 |
+--------------+
|      2199650 |             <-------------- That is wrong. This does not work here, white space is a problem for the query.
+--------------+

mysql> SELECT MAX(tbid) FROM thunderbox;
+-----------+
| MAX(tbid) |
+-----------+
|     14018 |             <-------------- That is correct.
+-----------+

mysql> SELECT MAX(tbid)+1 FROM thunderbox;
+-------------+
| MAX(tbid)+1 |
+-------------+
|       14019 |             <-------------- That is correct.
+-------------+

mysql> SELECT MAX(tbid) + 1 FROM thunderbox;
+---------------+
| MAX(tbid) + 1 |
+---------------+
|         14019 |             <-------------- That is correct. This works here, white space is not a problem for the query.
+---------------+

How to repeat:
Can't. Created new tables and in new databases. It seems that the query parser handles the white space differently only on this one table. 

I am going to try to make a back and restore to the new system to see if the problem follows.
[27 Apr 2010 17:05] Sveta Smirnova
Thank you for the report.

But version 4.1.11 is very old and not supported anymore. Please try current version 5.1.46 and if problem still exists provide repeatable test case.
[27 May 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".