MySQL Forums
Forum List  »  General

Re: bug (5.6.22) in ADDTIME?
Posted by: Rick James
Date: January 26, 2015 06:35PM

Here's another user's opinion. GROUP BY is tricky, and there have been changes to the optimizer that indirectly affect the resultset you get.

Here's another variant on it:
https://mariadb.com/kb/en/mariadb/group-by-trick-has-been-optimized-away/

Bottom line: In this
SELECT x, y ... GROUP BY x
you should _not_ depend on which `y` you get.

Any of these _may_ cause the result set to change:
DELETE a row
UPDATE a row
OPTIMIZE TABLE
ANALYZE TABLE
ALTER TABLE
Change the ENGINE

Similarly, in
SELECT ... LIMIT 1 -- without an ORDER BY
One day you get one row; the next day you _might_ get different row.

Options: ReplyQuote


Subject
Written By
Posted
January 23, 2015 10:46AM
January 23, 2015 12:56PM
January 23, 2015 05:48PM
January 26, 2015 12:51PM
January 26, 2015 03:02PM
January 23, 2015 05:55PM
January 26, 2015 03:17PM
January 26, 2015 03:54PM
Re: bug (5.6.22) in ADDTIME?
January 26, 2015 06:35PM


Sorry, you can't reply to this topic. It has been closed.

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.