apache / apache/datafusion-sqlparser-rs
Unable to parse 'max' for optional precision column with MS Sql dialect
- Langage dominant
- Rust
- Étoiles
- 3.5k
- Forks
- 772
- Merge moyen
- 4 j 9 h
- PR mergées (30 j)
- 17
Description
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());
}
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par l’implémentation de varbinary et comparez-la avec la gestion de CharacterLength décrite dans l’issue. Exécutez le test fourni parse_ms_sql_varbinary_max ; c’est terminé lorsque l’instruction MS SQL CREATE TABLE avec varbinary(max) est analysée avec succès.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- databases
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100