zkfan / tungsten-replicator

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

sql_mode = 'NO_ENGINE_SUBSTITUTION' fails #112

Closed GoogleCodeExporter closed 9 years ago

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

1. Install Tungsten Replicator slave in direct mode.

2. Execute the following on the master in mysql console:

  1:  {QA.R2}[r1 tungsten (test)] > SET sql_mode='MODE_NO_ENGINE_SUBSTITUTION';
  2: ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'MODE_NO_ENGINE_SUBSTITUTION'
  3: {QA.R2}[r1 tungsten (test)] > SET sql_mode='NO_ENGINE_SUBSTITUTION';
  4: Query OK, 0 rows affected (0.00 sec)
  5: 
  6: {QA.R2}[r1 tungsten (test)] > create table t2 (i int);
  7: Query OK, 0 rows affected (0.01 sec)

What is the expected output?

Tungsten Replicator still ONLINE.

What do you see instead?

Slave goes OFFLINE:ERROR with the following log:

  java.sql.SQLSyntaxErrorException: Variable 'sql_mode' can't be set to the value of 'MODE_NO_ENGINE_SUBSTITUTION'

Note that:

  SET sql_mode='NO_ENGINE_SUBSTITUTION'
  translated into
  MODE_NO_ENGINE_SUBSTITUTION (additional "MODE_" at the beginning)
  in the binary log.

Thus, it seems that we read MODE_NO_ENGINE_SUBSTITUTION from the binlog, then 
reconstruct the SET sql_mode SQL statement, which fails as (2:) above fails in 
the pure command line too. Should we map MODE_NO_ENGINE_SUBSTITUTION into 
NO_ENGINE_SUBSTITUTION during extraction or applying phase?

Original issue reported on code.google.com by linas.vi...@gmail.com on 14 Jun 2011 at 6:14

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

Original comment by stephane...@gtempaccount.com on 14 Jun 2011 at 8:40

GoogleCodeExporter commented 9 years ago

Original comment by linas.vi...@gmail.com on 17 Jun 2011 at 4:12