Skip to content

Commit

Permalink
copr: fix wrong sql mode constants (#13567)
Browse files Browse the repository at this point in the history
close #13566

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

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
  • Loading branch information
gengliqi and ti-chi-bot committed Oct 6, 2022
1 parent 47d8c9e commit 9566107
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit 9566107

Please sign in to comment.