Author: afeldman
Description:
This issue is a blocker on upgrading mysql on the cluster.
MySQL >= 5.5 does not allow:
SET "unsigned int col that = 0" + (-1) - it results in the following error:
Error 'BIGINT UNSIGNED value is out of range in '(enwiki.article_feedback_revisions.afr_total + -(1))'' on query. Default database: 'enwiki'. Query: 'UPDATE /* ApiArticleFeedback::insertRevisionRating */ article_feedback_revisions SET afr_total = afr_total + -1,afr_count = afr_count + 0 WHERE afr_page_id = '28184' AND afr_rating_id = '2' AND afr_revision = '531863378''
The row value at the time was:
mysql:root@localhost [enwiki]> select * from article_feedback_revisions WHERE afr_page_id = '28184' AND afr_rating_id = '2' AND afr_revision = '531863378';
+-------------+--------------+---------------+-----------+-----------+
afr_page_id | afr_revision | afr_rating_id | afr_total | afr_count |
+-------------+--------------+---------------+-----------+-----------+
28184 | 531863378 | 2 | 0 | 1 |
+-------------+--------------+---------------+-----------+-----------+
If SQL_MODE is set to 'NO_UNSIGNED_SUBTRACTION' the behavior is more compatible with prior versions of mysql, however:
SET "unsigned int col that = 0" + (-1)
is still illegal, though:
SET "unsigned int col that = 0" - 1
becomes legal.
Version: master
Severity: major
Whiteboard: wikimedia[unmaintained]