mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 18:57:21 +00:00
Support SHOW COLLATION
(#564)
This commit is contained in:
parent
54a29e872d
commit
18881f8fcf
4 changed files with 47 additions and 0 deletions
|
@ -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!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue