Skip to content

Commit

Permalink
TiDB compatibility: Add support to utf8mb4_bin collation
Browse files Browse the repository at this point in the history
  • Loading branch information
digorithm authored and abonander committed Oct 17, 2020
1 parent 96609d4 commit f808a81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlx-core/src/mysql/types/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::types::Type;
const COLLATE_UTF8_GENERAL_CI: u16 = 33;
const COLLATE_UTF8_UNICODE_CI: u16 = 192;
const COLLATE_UTF8MB4_UNICODE_CI: u16 = 224;
const COLLATE_UTF8MB4_BIN: u16 = 46

impl Type<MySql> for str {
fn type_info() -> MySqlTypeInfo {
Expand All @@ -34,7 +35,7 @@ impl Type<MySql> for str {
| ColumnType::Enum
) && matches!(
ty.char_set,
COLLATE_UTF8MB4_UNICODE_CI | COLLATE_UTF8_UNICODE_CI | COLLATE_UTF8_GENERAL_CI
COLLATE_UTF8MB4_UNICODE_CI | COLLATE_UTF8_UNICODE_CI | COLLATE_UTF8_GENERAL_CI | COLLATE_UTF8MB4_BIN
)
}
}
Expand Down

0 comments on commit f808a81

Please sign in to comment.