- Date: 2014-09-15 21:00:47 UTC
- mto: This revision was merged to the branch mainline in revision 4402.
- Revision ID: monty@mariadb.org-20140915210047-prls1zl5gbs51hj2
Don't give warning if there are two unique keys used with INSERT .. ON DUPLICATE KEY UPDATE.
We should assume that the store engine will report the first duplicate key for this case.
From what i understood, if there's two unique keys that have duplicate keys (insert values (1,1); insert values(1,1);) the first key will report the first warning, the second warning isn't a problem since the first one reported a duplicate key
removed this line from test cases:
2710
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
included this line:
5307
#ifdef NOT_USED_IN_MARIADB
AND SQL_CLASS.CC
6023
Auxiliary function to check if the warning for unsafe repliction statements
6024
should be thrown or suppressed.
From what i understood it's only to don't log many useless messages, and if a 'real' problem occur thrown an error instead of supress it
Old code of suppression of unsafe logging error with LIMIT didn't work, because of wrong usage of my_interval_timer().
Suppress unsafe logging errors to the error log if we get too many unsafe logging errors in a short time.
as expected at sql_class.cc
This is to not overflow the error log with meaningless errors.
- Each error code is suppressed and counted separately.
- We do a 5 minute suppression of new errors if we get more than 10 errors in that time.
Only print unsafe logging errors if log_warnings > 1.