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

H2数据库 Merge 语法解析异常 #1942

Closed
godsmell opened this issue Sep 1, 2017 · 4 comments
Closed

H2数据库 Merge 语法解析异常 #1942

godsmell opened this issue Sep 1, 2017 · 4 comments
Milestone

Comments

@godsmell
Copy link

godsmell commented Sep 1, 2017

default
2017-09-01 20:12:08 INFO [com.alibaba.druid.pool.DruidDataSource] com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:854)- {dataSource-1} inited
2017-09-01 20:12:08 DEBUG [org.springframework.jdbc.core.JdbcTemplate] org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:505)- Executing SQL update [merge into person key(id) select * from person_test]
2017-09-01 20:12:08 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:110)- Fetching JDBC Connection from DataSource
2017-09-01 20:12:09 ERROR [com.alibaba.druid.filter.stat.StatFilter] com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:148)- merge sql error, dbType h2, sql : merge into person key(id) select * from person_test
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'erge into person key(id) select * f',expect IDENTIFIER, actual IDENTIFIER pos 5, line 1, column 6, token IDENTIFIER into
at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:280)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:385)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:78)
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:43)
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:146)
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:634)
at com.alibaba.druid.filter.stat.StatFilter.internalBeforeStatementExecute(StatFilter.java:402)
at com.alibaba.druid.filter.stat.StatFilter.statementExecuteUpdateBefore(StatFilter.java:330)
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeUpdate(FilterEventAdapter.java:324)
at com.alibaba.druid.filter.FilterChainImpl.statement_executeUpdate(FilterChainImpl.java:2486)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeUpdate(StatementProxyImpl.java:241)
at com.alibaba.druid.pool.DruidPooledStatement.executeUpdate(DruidPooledStatement.java:243)
at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:509)
at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:1)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:519)
at nari.test.redisson.DuridH2Test.executeNonQuery(DuridH2Test.java:48)
at nari.test.redisson.DuridH2Test.main(DuridH2Test.java:56)
2017-09-01 20:12:09 DEBUG [org.springframework.jdbc.core.JdbcTemplate] org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:511)- SQL update affected 8 rows
2017-09-01 20:12:09 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:332)- Returning JDBC Connection to DataSource

@godsmell godsmell changed the title H2数据库 Merg 语法解析异常 H2数据库 Merge 语法解析异常 Sep 1, 2017
@wenshao
Copy link
Member

wenshao commented Sep 9, 2017

目前对h2的语法支持不够好,主要是这个数据库使用不够广泛

@wenshao wenshao added this to the 1.1.4 milestone Sep 9, 2017
@godsmell
Copy link
Author

@wenshao 请教大师,能否通过某种方式关闭 H2 中对 merge 或者其他SQL中 语法解析失败的检测?

@wenshao
Copy link
Member

wenshao commented Sep 10, 2017

已经支持,会尽快预计在10月1日国庆期间会发布新版本

@wenshao
Copy link
Member

wenshao commented Oct 3, 2017

https://github.com/alibaba/druid/releases/tag/1.1.4
问题已经修复,请使用新版本

@wenshao wenshao closed this as completed Oct 3, 2017
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

2 participants