【 使用环境 】 测试环境
【 OB or 其他组件 】flyway
【 使用版本 】oceanbase3.2.3 client 2.4.9 jdk17
【问题描述】
使用springboot 集成flyway 版本是10.16.0 。已经适配了mysql、oracle 集成执行sql脚本都没有问题。但是在集成oceanbase的时候,出现ORA-00900的错误。依赖的版本是
org.flywaydb
flyway-database-oceanbase
10.16.0
日志:
SQL State : 42000
Error Code : 900
Message : (conn=540390) ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ')' at line 1
2024-08-30 16:27:31.880 INFO 14772 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2024-08-30 16:27:31.940 INFO 14772 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2024-08-30 16:27:32.020 INFO 14772 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-08-30 16:27:32.066 ERROR 14772 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Unable to determine the original schema for the connection
----------------------------------------------------------
SQL State : 42000
Error Code : 900
Message : (conn=540390) ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ')' at line 1
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1806)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
at org.resoft.ResoftFlyway.main(ResoftFlyway.java:14)
Caused by: org.flywaydb.core.internal.exception.FlywaySqlException: Unable to determine the original schema for the connection
----------------------------------------------------------
SQL State : 42000
Error Code : 900
Message : (conn=540390) ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ')' at line 1
at org.flywaydb.core.internal.database.base.Connection.<init>(Connection.java:55)
at org.flywaydb.database.mysql.MySQLConnection.<init>(MySQLConnection.java:52)
at org.flywaydb.community.database.oceanbase.OceanBaseConnection.<init>(OceanBaseConnection.java:45)
at org.flywaydb.community.database.oceanbase.OceanBaseDatabase.doGetConnection(OceanBaseDatabase.java:56)
at org.flywaydb.community.database.oceanbase.OceanBaseDatabase.doGetConnection(OceanBaseDatabase.java:48)
at org.flywaydb.core.internal.database.base.Database.getConnection(Database.java:104)
at org.flywaydb.core.internal.database.base.Database.getMainConnection(Database.java:295)
at org.flywaydb.core.internal.schemahistory.SchemaHistoryFactory.prepareSchemas(SchemaHistoryFactory.java:67)
at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:186)
at org.flywaydb.core.Flyway.migrate(Flyway.java:164)
at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1802)
... 18 common frames omitted
sql脚本的内容是
CREATE TABLE PRO.USER_XXC(USERID VARCHAR2(120),USERNAME VARCHAR2(120))