mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
Parse Postgres VARBIT datatype (#1703)
This commit is contained in:
parent
86abbd6028
commit
cad49232c1
4 changed files with 35 additions and 1 deletions
|
@ -5327,3 +5327,29 @@ fn parse_bitstring_literal() {
|
|||
))]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_varbit_datatype() {
|
||||
match pg_and_generic().verified_stmt("CREATE TABLE foo (x VARBIT, y VARBIT(42))") {
|
||||
Statement::CreateTable(CreateTable { columns, .. }) => {
|
||||
assert_eq!(
|
||||
columns,
|
||||
vec![
|
||||
ColumnDef {
|
||||
name: "x".into(),
|
||||
data_type: DataType::VarBit(None),
|
||||
collation: None,
|
||||
options: vec![],
|
||||
},
|
||||
ColumnDef {
|
||||
name: "y".into(),
|
||||
data_type: DataType::VarBit(Some(42)),
|
||||
collation: None,
|
||||
options: vec![],
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue