Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql mode constants are not consistent with TiDB #13566

Closed
gengliqi opened this issue Sep 30, 2022 · 0 comments · Fixed by #13567
Closed

Sql mode constants are not consistent with TiDB #13566

gengliqi opened this issue Sep 30, 2022 · 0 comments · Fixed by #13567
Labels
severity/minor type/bug Type: Issue - Confirmed a bug

Comments

@gengliqi
Copy link
Member

gengliqi commented Sep 30, 2022

Bug Report

pub struct SqlMode: u64 {
const STRICT_TRANS_TABLES = 1 << 22;
const STRICT_ALL_TABLES = 1 << 23;
const NO_ZERO_IN_DATE = 1 << 24;
const NO_ZERO_DATE = 1 << 25;
const INVALID_DATES = 1 << 26;
const ERROR_FOR_DIVISION_BY_ZERO = 1 << 27;
}

The sql mode constants here are not consistent with TiDB's definition https://github.com/pingcap/tidb/blob/df5f05ff9bf49add2f08fffa00fe8336e7ffb73a/parser/mysql/const.go#L431-L436.

In fact, any value of the sql mode constant in TiKV is exactly twice as big as the one in TiDB.

Fortunately, due to another bug that TiDB doesn't set sql mode in DAGRequest(pingcap/tidb#38266), this bug was not triggered before.

ti-chi-bot added a commit that referenced this issue Oct 6, 2022
close #13566

Signed-off-by: gengliqi <gengliqiii@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor type/bug Type: Issue - Confirmed a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant