zxs / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 0 forks source link

The replicator parses a query incorrectly when it has inverse quotes for table and column #1066

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. In a master/slave topology, run the following:

use test ;
set binlog_format=statement;
drop table if exists t1;
create table t1 (id int not null primary key, first_column varchar(10));
insert into t1 values (1, 'aaa');
UPDATE `t1` SET first_column = NULL  WHERE `t1`.`id` = 1;
select * from t1;

2. Check the THL

3. check the table trep_commit_seqno

What is the expected output?

The thl and the table  report the shard_id as 'test'

What do you see instead?

thl list -seqno 31
Picked up JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
SEQ# = 31 / FRAG# = 0 (last frag)
- TIME = 2014-12-03 19:58:54.0
- EPOCH# = 0
- EVENTID = mysql-bin.000002:0000000000006906;53
- SOURCEID = gmini
- METADATA = [mysql_server_id=101;dbms_type=mysql;service=tsandbox;shard=t1` 
SET first_column = NULL  WHERE `t1]
- TYPE = com.continuent.tungsten.replicator.event.ReplDBMSEvent
- OPTIONS = [##charset = UTF-8, autocommit = 1, sql_auto_is_null = 0, 
foreign_key_checks = 1, unique_checks = 1, sql_mode = 'NO_ENGINE_SUBSTITUTION', 
character_set_client = 33, collation_connection = 33, collation_server = 8]
- SCHEMA = test
- SQL(0) = UPDATE `t1` SET first_column = NULL  WHERE `t1`.`id` = 1

select * from tungsten_tsandbox.trep_commit_seqno\G
*************************** 1. row ***************************
          task_id: 0
            seqno: 31
           fragno: 0
        last_frag: 1
        source_id: localhost
     epoch_number: 0
          eventid: mysql-bin.000002:0000000000006906;53
  applied_latency: 0
 update_timestamp: 2014-12-03 12:58:54
         shard_id: t1` SET first_column = NULL  WHERE `t1
extract_timestamp: 2014-12-03 12:58:54

What is the possible cause?

parse error, probably due to a greedy regular expression.

What is the proposed solution?

make the regular expression behave better.

Additional information

...

Use labels and text to provide additional information.

Original issue reported on code.google.com by g.maxia on 3 Dec 2014 at 1:06

GoogleCodeExporter commented 9 years ago

Original comment by g.maxia on 3 Dec 2014 at 1:51

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2692.

Original comment by stephane...@continuent.com on 5 Dec 2014 at 7:46

GoogleCodeExporter commented 9 years ago
Tested. And a permanent test was added to the regression suite

Original comment by g.maxia on 8 Dec 2014 at 1:34

GoogleCodeExporter commented 9 years ago

Original comment by linas.vi...@continuent.com on 20 Jan 2015 at 9:39

GoogleCodeExporter commented 9 years ago

Original comment by linas.vi...@continuent.com on 20 Jan 2015 at 9:42