Bug #31686 sql syntax error on replication slave
Submitted: 18 Oct 2007 7:07 Modified: 18 Nov 2007 8:23
Reporter: Corin Langosch Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.0.45 OS:Any
Assigned to: CPU Architecture:Any
Tags: slave fails with sql syntax error

[18 Oct 2007 7:07] Corin Langosch
Description:
we have a master and one slave replicating the master. queries are only sent to the master, the slave is not accessible (due to a firewall).

tonight the slave failed with

---
071018 09:03:04  mysqld started
071018  9:03:04 [Warning] The syntax for replication startup options is deprecated and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.
071018  9:03:05  InnoDB: Started; log sequence number 757 2798555926
071018  9:03:05 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.0.45'  socket: '/var/run/mysqld/mysqld_db2.sock'  port: 23306  MySQL Community Server (GPL)
071018  9:03:05 [Note] Slave SQL thread initialized, starting replication in log 'log-bin.000076' at position 3062349, relay log '/backups/mysql-replication/db2/relay-bin.000232' position: 3062484
071018  9:03:05 [Note] Slave I/O thread: connected to master 'replication@db2:3306',  replication started in log 'log-bin.000081' at position 389814107
071018  9:03:05 [ERROR] Slave: 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 '' at line 42' on query. Default database: 'ads'. Query: 'INSERT INTO
            data_raw_ad_impression
            (
                viewer_id,
                viewer_session_id,
                date_time,
                ad_id,
                creative_id,
                zone_id,
                channel_ids,
                language,
                ip_address,
                host_name,
                https,
                domain,
                page,
                search_term,
                user_agent,
                os,
                browser,
                max_https
            )
        VALUES
            (
                '2c367f33ac0c1726d727ce9557194f5d',
                '',
                '2007-10-17 19:19:50',
                '11',
                '0',
                '8',
                '|',
                'de',
                '85.13
071018  9:03:05 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'log-bin.000076' position 3062349
---

i wonder how this could happen? the query seems to be cut. also i assume the master writes broken queries to the binlog?

How to repeat:
no plan, sorry
[18 Oct 2007 8:23] Sveta Smirnova
Thankyou for the report.

Please provide associated master binary log and slave relay log. Also provide output of SHOW SLAVE STATUS.
[19 Nov 2007 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".