Bug #40350 Mysql Master-Slave Replication. Last_Errno: 1064 on Slave.
Submitted: 27 Oct 2008 15:29 Modified: 24 Dec 2008 8:47
Reporter: Suresh Shanmughom Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.0.45 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Replication fails with Errno 1064: You have an error in your SQL syntax

[27 Oct 2008 15:29] Suresh Shanmughom
Description:
I configured master-slave replication yesterday and getting the error  Last_Errno: 1064

mysql> show slave status \G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: hptca02
                Master_User: slave_user
                Master_Port: 3306
              Connect_Retry: 60
            Master_Log_File: hptca02_bin.000002
        Read_Master_Log_Pos: 831580828
             Relay_Log_File: slave-relay.000010
              Relay_Log_Pos: 2017880
      Relay_Master_Log_File: hptca02_bin.000002
           Slave_IO_Running: Yes
          Slave_SQL_Running: No
            Replicate_Do_DB:
        Replicate_Ignore_DB:
         Replicate_Do_Table:
     Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                 Last_Errno: 1064
                 Last_Error: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
        where feature =  NAME_CONST('p_feature',_latin1'Scheduling')' at line 2' on query. Default database: 'tca'. Query: 'update TCAControl
        set enabled =  NAME_CONST('p_enabled',)
        where feature =  NAME_CONST('p_feature',_latin1'Scheduling')'
               Skip_Counter: 0
        Exec_Master_Log_Pos: 2028294
            Relay_Log_Space: 831570696
            Until_Condition: None
             Until_Log_File:
              Until_Log_Pos: 0
         Master_SSL_Allowed: No
         Master_SSL_CA_File:
         Master_SSL_CA_Path:
            Master_SSL_Cert:
          Master_SSL_Cipher:
             Master_SSL_Key:
      Seconds_Behind_Master: NULL
1 row in set (0.00 sec)

Slave
======
 mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.0.45-community-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like 'cha%' ;
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

Master
======
 mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3302
Server version: 5.0.45-community-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like 'cha%' ;
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

Please let me know a work around or a fix.

Please let me know if you need any additional information or any bin logs to resolve this issue. 

How to repeat:
I tried a couple of times configuring master-slave replication and got Last_Errno: 1064.  Now the slave is out of sync.
[27 Oct 2008 15:41] Sveta Smirnova
Thank you for the report.

But version 5.0.45 is old and at least 1 important bug which caused error 1064 was fixed since. Please upgrade both master and slave to current version 5.0.67, try with it and if problem still exists provide configuration files for both master and slave and corresponding binary log.
[8 Nov 2008 10:19] Drew Bertola
I had the same problem on CentOS 5.2 w/ 5.045-log.  I pulled a source rpm out of the upcoming fedora 10, did a rebuild, and the bug did not show up again.

I have no strong validation that all is well, but this particular use case does not show the same error anymore.  

BTW, there are several other bug reports that suggest a similar problem (no two the same, but similar nonetheless).
[28 Nov 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Dec 2008 17:33] Suresh Shanmughom
Upgraded to 5.0.67.  Re-initialized replication and it works !!!

Thank you.
[24 Dec 2008 8:47] Valeriy Kravchuk
Closed as not repeatable with 5.0.67.