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

copr: fix wrong sql mode constants #13567

Merged
merged 2 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions components/tidb_query_datatype/src/expr/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use crate::codec::mysql::Tz;
bitflags! {
/// Please refer to SQLMode in `mysql/const.go` in repo `pingcap/parser` for details.
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;
const STRICT_TRANS_TABLES = 1 << 21;
const STRICT_ALL_TABLES = 1 << 22;
const NO_ZERO_IN_DATE = 1 << 23;
const NO_ZERO_DATE = 1 << 24;
const INVALID_DATES = 1 << 25;
const ERROR_FOR_DIVISION_BY_ZERO = 1 << 26;
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/tidb_query_expr/src/impl_regexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn build_regexp_from_args<C: Collator>(
b""
};

build_regexp::<C>(pattern, match_type).map(|reg| Some(reg))
build_regexp::<C>(pattern, match_type).map(Some)
}

fn init_regexp_data<C: Collator, const N: usize>(expr: &mut Expr) -> Result<Option<Regex>> {
Expand All @@ -111,7 +111,7 @@ fn init_regexp_data<C: Collator, const N: usize>(expr: &mut Expr) -> Result<Opti
b""
};

build_regexp::<C>(pattern, match_type).map(|reg| Some(reg))
build_regexp::<C>(pattern, match_type).map(Some)
}

/// Currently, TiDB only supports regular expressions for utf-8 strings.
Expand Down