We're updating the issue view to help you get more done. 

SchemaUpdate doesn't work with Sybase

Description

Test org.hibernate.test.schemaupdate.foreignkeys.SchemaUpdateWithKeywordAutoQuotingEnabledTest fails with Sybase. Despite test name, value of property hibernate.auto_quote_keyword isn't important. Test always fails.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 org.hibernate.tool.schema.spi.SchemaManagementException: Halting on error : Error executing DDL "create table "MATCH" (id bigint not null, primary key (id)) lock datarows" via JDBC Statement at org.hibernate.tool.schema.internal.ExceptionHandlerHaltImpl.handleException(ExceptionHandlerHaltImpl.java:27) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:444) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:315) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121) at org.hibernate.tool.hbm2ddl.SchemaExport.doExecution(SchemaExport.java:298) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:249) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:228) at org.hibernate.tool.hbm2ddl.SchemaExport.createOnly(SchemaExport.java:224) at org.hibernate.test.schemaupdate.foreignkeys.SchemaUpdateWithKeywordAutoQuotingEnabledTest.setUp(SchemaUpdateWithKeywordAutoQuotingEnabledTest.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.lang.Thread.run(Thread.java:748) Caused by: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table "MATCH" (id bigint not null, primary key (id)) lock datarows" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440) ... 23 more Caused by: com.sybase.jdbc4.jdbc.SybSQLException: There is already an object named 'MATCH' in the database. at com.sybase.jdbc4.tds.Tds.processEed(Tds.java:4003) at com.sybase.jdbc4.tds.Tds.nextResult(Tds.java:3093) at com.sybase.jdbc4.jdbc.ResultGetter.nextResult(ResultGetter.java:78) at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:289) at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:271) at com.sybase.jdbc4.jdbc.SybStatement.executeLoop(SybStatement.java:2593) at com.sybase.jdbc4.jdbc.SybStatement.execute(SybStatement.java:2580) at com.sybase.jdbc4.jdbc.SybStatement.execute(SybStatement.java:1292) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 24 more

In setUp phase everything looks good

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 13:30:16,515 DEBUG SQL:94 - create table MATCH ( id bigint not null, primary key (id) ) lock datarows Hibernate: create table MATCH ( id bigint not null, primary key (id) ) lock datarows 13:30:16,661 INFO access:47 - HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@6d75f68d] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode. 13:30:17,333 DEBUG SQL:94 - create table Match_timeline ( Match_id bigint not null, timeline int null, timeline_KEY int not null, primary key (Match_id, timeline_KEY) ) lock datarows Hibernate: create table Match_timeline ( Match_id bigint not null, timeline int null, timeline_KEY int not null, primary key (Match_id, timeline_KEY) ) lock datarows 13:30:17,581 DEBUG SQL:94 - alter table Match_timeline add constraint FKo4eymwd6e6d337l2rexf0eguv foreign key (Match_id) references MATCH Hibernate: alter table Match_timeline add constraint FKo4eymwd6e6d337l2rexf0eguv foreign key (Match_id) references MATCH

but in test update tries to create table again

1 2 3 4 5 6 7 8 9 10 13:30:18,752 DEBUG SQL:94 - create table MATCH ( id bigint not null, primary key (id) ) lock datarows Hibernate: create table MATCH ( id bigint not null, primary key (id) ) lock datarows

Environment

Sybase - org.hibernate.dialect.SybaseASE157Dialect

Status

Assignee

Andrea Boriero

Reporter

Martin Šimka

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.3.3

Priority

Major