-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
使用Oracle数据库运行,启动报错。 #12569
Labels
Comments
@huangkemingyyds 根本就不是插件的问题 |
@i will solve it@ |
有不同方言的情况下, 最好是抽到插件去实现。不然怎么改都有可能有不支持的SQL和数据源 |
常规方案,应该是提到插件中不同方言来实现。 |
我也思考过这个问题,就目前来说,在工程代码中目前还是存在声明式sql, 并没有完全通过插件实现。 |
可以尝试使用 JDBC API: DatabaseMetaData.getTables() 来完成 但是这有个前提,数据库的JDBC驱动,都实现了这个方法 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
使用Oracle数据库运行,启动报错。
报错内容:
2024-08-30 17:15:12,901 WARN HikariPool-1 - Connection oracle.jdbc.driver.T4CConnection@4653747d marked as broken because of SQLSTATE(0A000), ErrorCode(304 7)
java.sql.SQLException: ORA-03047: number '1' is not syntactically valid following '...1 FROM config_info_tag LIMIT '
https://docs.oracle.com/error-help/db/ora-03047/
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:709)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:609)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1290)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:1100)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:408)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:483)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:170)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:1029)
at oracle.jdbc.driver.OracleStatement.prepareDefineBufferAndExecute(OracleStatement.java:1299)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1224)
at oracle.jdbc.driver.OracleStatement.executeSQLSelect(OracleStatement.java:1592)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1442)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1858)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:382)
at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:111)
at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:453)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:383)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:466)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:476)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:509)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:516)
at com.alibaba.nacos.core.namespace.repository.ExternalNamespacePersistServiceImpl.isExistTable(ExternalNamespacePersistServiceImpl.java:165)
at com.alibaba.nacos.config.server.service.dump.DumpService.dumpOperate(DumpService.java:274)
at com.alibaba.nacos.config.server.service.dump.ExternalDumpService.init(ExternalDumpService.java:65)
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.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcess or.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBea nPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPos tProcessor.java:157)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapable BeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:781)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:220)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
at com.alibaba.nacos.Nacos.main(Nacos.java:46)
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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: oracle.jdbc.OracleDatabaseException: ORA-03047: number '1' is not syntactically valid following '...1 FROM config_info_tag LIMIT '
Expected behavior
期望在启动时,nacos.log 中无异常
Actually behavior
报错会发生在 查询表 config_info_tag, config_info_beta 是否存在时,
How to Reproduce
Steps to reproduce the behavior:
问题原因
Oracle中分页不支持 Limit关键字,而在 ExternalNamespacePersistServiceImpl#isExistTable 方法中,查询指定表是否存在时,使用了limit关键字,是写死了的。没有通过插件的方式让自定义。
The text was updated successfully, but these errors were encountered: