Add support for unit on char length units for small character string types. (#663)

This results in complete support for ANSI CHARACTER, CHAR, CHARACTER VARYING,
CHAR VARYING, and VARCHAR.
This commit is contained in:
AugustoFKL 2022-10-11 09:54:15 -03:00 committed by GitHub
parent 777672625f
commit cacdf3305f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 244 additions and 34 deletions

View file

@ -74,7 +74,10 @@ fn parse_create_table_with_defaults() {
},
ColumnDef {
name: "first_name".into(),
data_type: DataType::CharacterVarying(Some(45)),
data_type: DataType::CharacterVarying(Some(CharacterLength {
length: 45,
unit: None
})),
collation: None,
options: vec![ColumnOptionDef {
name: None,
@ -83,7 +86,10 @@ fn parse_create_table_with_defaults() {
},
ColumnDef {
name: "last_name".into(),
data_type: DataType::CharacterVarying(Some(45)),
data_type: DataType::CharacterVarying(Some(CharacterLength {
length: 45,
unit: None
})),
collation: Some(ObjectName(vec![Ident::with_quote('"', "es_ES")])),
options: vec![ColumnOptionDef {
name: None,
@ -92,7 +98,10 @@ fn parse_create_table_with_defaults() {
},
ColumnDef {
name: "email".into(),
data_type: DataType::CharacterVarying(Some(50)),
data_type: DataType::CharacterVarying(Some(CharacterLength {
length: 50,
unit: None
})),
collation: None,
options: vec![],
},