Bug #51446 error message not run through printf() properly (or missing arguments)
Submitted: 24 Feb 2010 5:11 Modified: 28 Jul 2011 9:28
Reporter: Arjen Lentz Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0.87, 5.1, 5.5.99 OS:Any
Assigned to: Zhenxing He CPU Architecture:Any

[24 Feb 2010 5:11] Arjen Lentz
Description:
Replication breakage, SHOW SLAVE STATUS reports

Last_Error: Query caused different errors on master and slave. Error on master: 'Column count doesn't match value count at row %ld' (1136), Error on slave: 'no error' (0). Default database: 'ABC'. Query: 'SELECT ....'

That %ld shouldn't be there, of course. Must be some kind of code bug.

How to repeat:
Check in source

Suggested fix:
fix up the printf call
[25 Feb 2010 14:39] Valeriy Kravchuk
Can you, please, check if the same problem happens with a newer version, 5.0.90? 

I've checked the code of current mysql-5.0 tree and had not found any place where argument is missing:

77-52-24-143:mysql-5.0 openxs$ grep -rn ER_WRONG_VALUE_COUNT_ON_ROW *include/mysqld_ername.h:139:{ "ER_WRONG_VALUE_COUNT_ON_ROW", 1136 },
include/mysqld_error.h:140:#define ER_WRONG_VALUE_COUNT_ON_ROW 1136
include/sql_state.h:65:ER_WRONG_VALUE_COUNT_ON_ROW             ,"21S01", "",
mysql-test/t/create.test:693:--error ER_WRONG_VALUE_COUNT_ON_ROW
sql/share/errmsg.txt:3195:ER_WRONG_VALUE_COUNT_ON_ROW 21S01 
sql/sql_insert.cc:186:      my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L);
sql/sql_insert.cc:210:      my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L);
sql/sql_insert.cc:668:      my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
sql/sql_insert.cc:3375:    my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1);
sql/sql_prepare.cc:1089:        my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
[26 Feb 2010 3:56] Arjen Lentz
Valeriy, asking me to recreate this weird repl error with a later version is a tad unrealistic. I also don't think it has relevance for the issue.

Is the error text passed through the binlog, or is it just the error code?
If it's only the error code, the whole logic is flawed since then printing the message belonging with the code requires the arguments, which won't be there.
Someone in the repl team might need to look at this to verify what's going on.
[2 Mar 2010 9:42] Sveta Smirnova
Thank you for the feedback.

Yes, having %ld in the log is strange. But also is interesting how you got such error. Could you please check binary log to see which kind of query caused the error?
[2 Mar 2010 9:56] Sveta Smirnova
Btw having formatting symbols in SHOW SLAVE STATUS output can be verified with test case for bug #51426.
[2 Mar 2010 13:33] Arjen Lentz
Sorry Sveta, unfortunately I don't have that binlog chunk available.
But I see you found another way to verify the issue.
[28 Jul 2011 9:28] Jon Stephens
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.