Support SHOW COLLATION (#564)

This commit is contained in:
Alex Qyoun-ae 2022-08-11 17:28:34 +04:00 committed by GitHub
parent 54a29e872d
commit 18881f8fcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View file

@ -189,6 +189,12 @@ fn parse_show_extended_full() {
assert!(mysql_and_generic()
.parse_sql_statements("SHOW EXTENDED FULL CREATE TABLE mytable")
.is_err());
assert!(mysql_and_generic()
.parse_sql_statements("SHOW EXTENDED FULL COLLATION")
.is_err());
assert!(mysql_and_generic()
.parse_sql_statements("SHOW EXTENDED FULL VARIABLES")
.is_err());
}
#[test]
@ -213,6 +219,28 @@ fn parse_show_create() {
}
}
#[test]
fn parse_show_collation() {
assert_eq!(
mysql_and_generic().verified_stmt("SHOW COLLATION"),
Statement::ShowCollation { filter: None }
);
assert_eq!(
mysql_and_generic().verified_stmt("SHOW COLLATION LIKE 'pattern'"),
Statement::ShowCollation {
filter: Some(ShowStatementFilter::Like("pattern".into())),
}
);
assert_eq!(
mysql_and_generic().verified_stmt("SHOW COLLATION WHERE 1 = 2"),
Statement::ShowCollation {
filter: Some(ShowStatementFilter::Where(
mysql_and_generic().verified_expr("1 = 2")
)),
}
);
}
#[test]
fn parse_use() {
assert_eq!(