Skip to content

Unable to parse 'max' for optional precision column with MS Sql dialect #1714

Open
@TylerBrinks

Description

@TylerBrinks

The following is a valid MS Sql query, but cannot ne parsed due to the varbinary implementation.

Variable character-based columns, nvarchar and varchar, use a union type CharacterLength type that allows for either IntegerLength or Max values. The varbinary implementation needs a similar union, such as BinaryLength (reusing CharacterLength seems to have a naming mismatch).

#[test]
fn parse_ms_sql_varbinary_max(){
    let sql = "CREATE TABLE example(VarBinaryMaxCol varbinary(max) not null);";
    let parsed = ms().parse_sql_statements(sql);
    
    assert!(parsed.is_ok());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions