[MDEV-6753] MariaDB 10.0.13 reports malformed/wrong table name at the replication error message Created: 2014-09-18  Updated: 2022-09-12  Resolved: 2022-09-12

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.0.13
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Stoykov (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: upstream
Environment:

CentOS 6



 Description   

On replication failure, the error message contains malformed/wrong table name as seen bellow:

[ERROR] Slave SQL: Query caused different errors on master and slave. Error on master: message (format)='Tablespace for table '%-.192s' exists.



 Comments   
Comment by Elena Stepanova [ 2014-09-18 ]

It was an intentional change in MySQL, the key word here is "(format)".
See http://bugs.mysql.com/bug.php?id=46697:

Previously, when a statement failed with a different error on the
slave than on the master, the slave SQL thread displayed a message
containing:

  • The error message for the master error code
  • The master error code
  • The error message for the slaves error code
  • The slave error code

However, the slave has no information with which to fill in any print
format specifiers for the master message, so it actually displayed
the message format string. To make it clearer that the slave is not
displaying the actual message as it appears on the master, the slave
now indicates that the master part of the output is the message
format, not the actual message. For example, previously the slave
displayed information like this:

Error: "Query caused different errors on master and slave. Error on
master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on
slave: 'no error' (0). Default database: 'test'. Query: 'insert into
t1 values(1),(2)'" (expected different error codes on master and
slave)

Now the slave displays this:

Error: "Query caused different errors on master and slave. Error on
master: message format='Duplicate entry '%-.192s' for key %d' error
code=1062 ; Error on slave: actual message='no error', error code=0.
Default database: 'test'. Query: 'insert into t1 values(1),(2)'"
(expected different error codes on master and slave)

Comment by Elena Stepanova [ 2014-09-22 ]

Please comment to re-open if you disagree.

Comment by Simon J Mudd [ 2014-09-22 ]

Hi. I agree this is not a bug per se but the message is confusing as presented, but again triggered by an upstream problem.

That said I´d like to see this shown differently to make it much clearer what the problem is and where it comes from.

So I´d suggest the following:

(1) make this report the different error messages on different lines, this makes the huge “blob of an error message” easier to read.
(2) if you don’t know the text on the master say so more clearly: showing printf formatting is just silly.

An example below (reformatted) but with the SQL munged somewhat to protect the innocent looks much easier to understand:

140917 21:30:04 [ERROR] Slave SQL: Query caused different errors on master and slave.
140917 21:30:04 [ERROR] => Error on master[error code=1813]: 'Tablespace for table '<VALUE_FROM_MASTER_UNKNOWN>' exists. Please DISCARD the tablespace before IMPORT.'
140917 21:30:04 [ERROR] => Error on slave[error code=0] (no error)
140917 21:30:04 [ERROR] => Default database: 'xxxxxx'. Query: 'CREATE TABLE `xxxxxxx_YYYYMMDD` (
`xxxxxxxxx_id` mediumint(8) unsigned NOT NULL,
`xxxxx_id` int(11) NOT NULL DEFAULT '0',
`xxxxx` varchar(255) DEFAULT NULL,
`xxxxxxxxx_id` smallint(5) unsigned DEFAULT NULL,
`xxxx_id` int(11) DEFAULT NULL,
`xxxxxxxx` int(10) unsigned DEFAULT NULL,
`xxxxxxxxxxxxxxxx` int(10) unsigned DEFAULT NULL,
`xxxxxxxxxxx` int(10) unsigned DEFAULT NULL,
`xxxxxxxxxx` mediumint(8) unsigned DEFAULT NULL,
`xxxxxxxxxxxxxxxxxxxxxx` decimal(10,2) DEFAULT NULL,
`xxxxxxxx` decimal(10,2) DEFAULT NULL,
`xxx` decimal(12,4) NOT NULL DEFAULT '0.0000',
`xxxxxxxxx` double NOT NULL DEFAULT '1',
`xxxxxxxxxx
...

Replace any format values with something like VALUE_FROM_MASTER_UNKNOWN.
Trying to merge an error of this type into a single long line just gives me a headache.

Comment by Sergei Golubchik [ 2022-09-12 ]

10.0 was EOLed in March 2019

Generated at Thu Feb 08 07:14:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.