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

[BUG] toSqlString function drops WITH clause #6188

Open
Tony2h opened this issue Oct 23, 2024 · 0 comments
Open

[BUG] toSqlString function drops WITH clause #6188

Tony2h opened this issue Oct 23, 2024 · 0 comments

Comments

@Tony2h
Copy link

Tony2h commented Oct 23, 2024

Database Type

MySql

Database Version

Mysql

Druid Version

1.2.18

JDK Version

OpenJDK 8

Error SQL

insert into test.a select id, name from test.b where ast='1'
union all
( with T1 AS (select f.no, f.name from test.f f), T2 AS (select c.no, c.name from test.c c)
select T1.no, T2.name from T1 T1, T2 T2 where T1.no = T2.no)
union all
( with T3 AS (select f.no, f.name from test.ff f), T4 AS (select c.no, c.name from test.cc c)
select T3.no, T4.name from T3 T3, T4 T4 where T3.no = T4.no )

Testcase Code

String sql = xxx;
List<SQLStatement> stats = SQLUtils.parseStatements(sql, DbType.mysql)
System.out.println(SQLUtils.toSQLString(stats.get(0), DbType.mysql));

Stacktrace Info

No response

Error Info

No response

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

1 participant