alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.97k stars 8.58k forks source link

springboot2.7.8 + mysql 8.4.0 + druid-springboot-starter 不能用withRecursive递归查询,一使用就报语法错误,sql本身是没问题 #5965

Closed lesionlinlin closed 4 months ago

lesionlinlin commented 5 months ago

springboot2.7.8 + mysql 8.4.0 + druid-springboot-starter 不能用withRecursive递归查询,一使用就报语法错误,sql本身是没问题

Error querying database. Cause: java.sql.SQLException: sql injection violation, dbType mysql, , druid-version 1.2.8, syntax error: syntax error, error in :'xc_region, cte WHERE xc_region', expect ), actual null, pos 119, line 1, column 118, token IDENTIFIER : WITH RECURSIVE `CTE` AS ((SELECT * FROM `xc_region` WHERE `pid` = ?) UNION ALL (SELECT `xc_region`.* FROMxc_region,cte` WHERExc_region.pid =cte.id )) SELECT * FROMcte`

lizongbo commented 5 months ago

发完整的sql语句来,这个语法是加了支持的