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

Support CREATE INDEX #475

Closed
alulu-zh opened this issue Nov 27, 2017 · 1 comment
Closed

Support CREATE INDEX #475

alulu-zh opened this issue Nov 27, 2017 · 1 comment

Comments

@alulu-zh
Copy link

Please answer these questions before submitting your issue. Thanks!

Which version of Sharding-Jdbc do you using?

Expected behavior

jpa会通过create index语句来创建索引,但是sharding jdbc只支持create table语句。
error log:

Caused by: io.shardingjdbc.core.parsing.parser.exception.SQLParsingUnsupportedException: Not supported token 'INDEX'.
	at io.shardingjdbc.core.parsing.lexer.LexerEngine.unsupportedIfNotSkip(LexerEngine.java:184) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.parsing.parser.sql.ddl.create.AbstractCreateParser.parse(AbstractCreateParser.java:54) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.parsing.parser.sql.ddl.create.AbstractCreateParser.parse(AbstractCreateParser.java:35) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.parsing.SQLParsingEngine.parse(SQLParsingEngine.java:50) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.routing.router.ParsingSQLRouter.parse(ParsingSQLRouter.java:72) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.routing.StatementRoutingEngine.route(StatementRoutingEngine.java:47) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.jdbc.core.statement.ShardingStatement.generateExecutor(ShardingStatement.java:191) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at io.shardingjdbc.core.jdbc.core.statement.ShardingStatement.executeUpdate(ShardingStatement.java:110) ~[sharding-jdbc-core-2.0.0.M3.jar:na]
	at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:420) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applyIndexes(SchemaMigratorImpl.java:283) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:184) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:472) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]

Actual behavior

Steps to reproduce the behavior

Please provide the reproduce example codes (such as github link) if possible.

haocao added a commit that referenced this issue Dec 27, 2017
haocao added a commit that referenced this issue Dec 27, 2017
@haocao haocao closed this as completed in 4bccaef Dec 27, 2017
@terrymanu terrymanu changed the title 不支持create index语句 Support CREATE INDEX Aug 8, 2018
@terrymanu
Copy link
Member

finished at 2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@haocao @terrymanu @alulu-zh and others