apache / apache/datafusion-sqlparser-rs

Duplicate column in CREATE TABLE statement

未关闭
#668 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
17

描述

SQLite raises a parser error with the following DDL:
```sh
sqlite> CREATE TABLE test (
...> x TEXT,
...> x TEXT
...> );
Parse error: duplicate column name: x
```
But `sqlparser` doesn't:

```sh
% cargo run --example cli ddl.sql --sqlite
...
Round-trip:
'CREATE TABLE test (x TEXT, x TEXT)'
Parse results:
[
CreateTable {
...
```
Is this kind of checks considered out of scope ?
Thanks.

贡献指南

这个仓库没有索引到贡献指南

调研方向

使用 SQLite DDL 和 `cargo run --example cli ddl.sql --sqlite` 命令复现这一差异。首先跟踪 CREATE TABLE 语句的解析过程,然后确定是否应拒绝重复的列名。当该输入对应的 parser 行为得到决定并且有一致的覆盖时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust, sql
领域
databases
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。