Comments (2)
postgresql支持这个,mysql不支持,参考加上了支持
from druid.
这个sql语句太复杂,目前还不太好解析支持。
public void test_parse() throws Exception {
String sql = "select\n"
+ " id,\n"
+ " (\n"
+ " WITH RECURSIVE link_hierarchy AS (\n"
+ " SELECT id, parent_id\n"
+ " FROM tmp_link\n"
+ " WHERE id = ?\n"
+ "\n"
+ " UNION ALL\n"
+ "\n"
+ " SELECT tl.id, tl.parent_id\n"
+ " FROM tmp_link tl\n"
+ " INNER JOIN link_hierarchy lh ON tl.id = lh.parent_id\n"
+ " )\n"
+ " SELECT CONCAT('/', GROUP_CONCAT(id ORDER BY id ASC SEPARATOR '/')) AS path\n"
+ " FROM link_hierarchy\n"
+ " ) as path\n"
+ " from tmp_link";
SQLStatementParser parser = SQLParserUtils.createSQLStatementParser(sql, JdbcConstants.MYSQL);
SQLStatement statement = parser.parseStatement();
System.out.println(statement);
}
from druid.
Related Issues (20)
- [BUG] 使用druid 最新版本1.2.23解析oracle 创建语句解析报错 语句中包含设置自增主键
- [BUG] Hive中,set role命令解析异常
- [BUG] Druid 1.2.20版本 解析MySQL异常语句,当列别名设置为星号(*)时,在MySQL数据库执行会抛出异常,但是使用MySqlStatementParser做解析时,会解析成子语句,未抛出异常,不符合MySQL语法规范
- [BUG] DM8设置connectTimeout和socketTimeout不起作用
- [BUG] 特殊join语法解析多个连接条件出错 HOT 1
- [BUG] druid-spring-boot-starter 在pringboot3.x中不支持自动装配 HOT 2
- [BUG] mysql-connector-j 8.2.0以后,项目启动时间变长
- [BUG] pg12多种sql语法解析失败 HOT 1
- [BUG] 不支持add column if not exists语法,解析会报错
- [BUG] 无法解析配置属性 'spring.datasource.druid.filter.stat.enabled'
- [BUG] 解析hive时如果 PARTITIONED BY 和 LOCATION 关键字之间有COMMENT解析失败 HOT 3
- [BUG] druid SqlParser在解析month和month()函数同时出现语句时报语法错误
- 大佬,帮看看 接口偶发报错问题 java.sql.SQLNonTransientConnectionException: Socket error HOT 2
- dynamic-datasource-spring-boot-starter兼容性问题 HOT 1
- [BUG] SQLUtils.refactor rewrite tablename error HOT 1
- sqlserver with(rowlock)语法解析报错 HOT 1
- [BUG] hive解析select语句多个逗号未正确抛出异常
- [BUG] 使用druid的1.2.8版本,获取连接时出现active为负数: wait millis 19, active -23616, maxActive 50, creating 1, createElapseMillis 39, runningSqlCount 1
- [BUG] druid 1.2.8 19c jdk8 listagg打印可执行sql 提示缺失右括号
- [BUG] merge sql error, dbType postgresql 不支持 ORDER BY case_count DESC NULLS LAST 语句
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from druid.