Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解析 Oceanbase 的 create table 语句时,不能处理 index 的 local/global 标记 #4833

Open
xiezhenye opened this issue Jun 16, 2022 · 1 comment

Comments

@xiezhenye
Copy link

create table name (
...
index somIndex(someField) LOCAL
)
        SQLStatement statements = SQLUtils.parseSingleStatement(sql, JdbcConstants.OCEANBASE, SQLParserFeature.KeepComments);
        MySqlCreateTableStatement createTable =  (MySqlCreateTableStatement) statements;

会报错 com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'someField) LOCAL ...

@xiezhenye
Copy link
Author

xiezhenye commented Jun 16, 2022

参考 oceanbase 的文档:

https://www.oceanbase.com/docs/enterprise/oceanbase-database/oceanbase-database/V2.2.77/create-table

类似的情况应该也会发生在 alter table add index 之类的语句上

jiangxianfu added a commit to jiangxianfu/druid that referenced this issue Jun 17, 2022
wenshao added a commit that referenced this issue Jun 19, 2022
fix: index for global index options #4833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant