Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

sql_mode=ANSI_QUOTE not working in version 2.0 #693

Closed
GMHDBJD opened this issue May 29, 2020 · 4 comments
Closed

sql_mode=ANSI_QUOTE not working in version 2.0 #693

GMHDBJD opened this issue May 29, 2020 · 4 comments
Labels
question This issue is a question severity/moderate

Comments

@GMHDBJD
Copy link
Collaborator

GMHDBJD commented May 29, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
    sql_mode=ANSI_QUOTE not working in version 2.0 but works fine in 1.0
    see config: support setting session variable #687 and config: support setting session variable (#687) #692

  2. What did you expect to see?
    sql_mode=ANSI_QUOTE works fine in 2.0

  3. What did you see instead?
    when set sql_mode=ANSI_QUOTE in 2.0, syncer raise error: ErrSchemaTrackerCannotParseDownstreamTable

  4. Versions of the cluster

    • DM version (run dmctl -V or dm-worker -V or dm-master -V):

      v2.0.0-beta.1-20-gfd03b9c-dev
      
    • Upstream MySQL/MariaDB server version:

      5.7.30
      
    • Downstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

      v4.0.0-beta.2-392-gb4f42abc3
      
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented May 29, 2020

this issue cause by https://github.com/pingcap/dm/blob/master/syncer/syncer.go#L584-L612.
If sql_mode="ANSI_QUOTE", show create table will return
Screenshot (36)
but pingcap/parser can't parse this sql .

@csuzhangxc
Copy link
Member

it seems both 1.0 and 2.0 are using github.com/pingcap/parser v0.0.0-20200422082501-7329d80eaf2c.

Is it caused by TiDB with mockTiKV in 2.0?

Can we resolve this by upgrade tidb & parser to a newer version? (or simply try it directly in a new tidb with mockTiKV)

@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented May 29, 2020

SetSQLMode can solve it. But seems not support string directly.

@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented May 31, 2020

set enable-ansi-quotes: true in task syncer config solve this problem.

@GMHDBJD GMHDBJD added the question This issue is a question label May 31, 2020
@GMHDBJD GMHDBJD closed this as completed May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question This issue is a question severity/moderate
Projects
None yet
Development

No branches or pull requests

3 participants