Fix holo order by quota. (#6456)
Java CI / Test JDK ${{ matrix.java }}, ${{ matrix.os }} (11, ubuntu-latest) (push) Has been cancelled Details
Java CI / Test JDK ${{ matrix.java }}, ${{ matrix.os }} (17, ubuntu-latest) (push) Has been cancelled Details
Java CI / Test JDK ${{ matrix.java }}, ${{ matrix.os }} (21, ubuntu-latest) (push) Has been cancelled Details
Java CI / Test JDK ${{ matrix.java }}, ${{ matrix.os }} (8, ubuntu-latest) (push) Has been cancelled Details

* Fix holo order by quota.

* Add test case.
This commit is contained in:
lingo-xp 2025-06-17 14:21:39 +08:00 committed by GitHub
parent 7cd44fcc56
commit d97cb18a20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 0 deletions

View File

@ -3041,6 +3041,16 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
if (expr instanceof SQLIntegerExpr) {
print(((SQLIntegerExpr) expr).getNumber().longValue());
} else if (expr instanceof SQLCharExpr) {
if (dialect != null) {
String name = "'" + ((SQLCharExpr) expr).getText() + "'";
printName0(replaceQuota(name));
} else {
printExpr(expr, parameterized);
}
} else if (expr instanceof SQLIdentifierExpr) {
((SQLIdentifierExpr) expr).setName(replaceQuota(((SQLIdentifierExpr) expr).getName()));
printExpr(expr, parameterized);
} else {
printExpr(expr, parameterized);
}

View File

@ -1,3 +1,12 @@
SELECT sum(ret_amount) AS '应收金额'
FROM test.test
GROUP BY a ORDER BY '应收金额' DESC;
--------------------
SELECT sum(ret_amount) AS `应收金额`
FROM test.test
GROUP BY a
ORDER BY `应收金额` DESC;
------------------------------------------------------------------------------------------------------------------------
select substr(${yesterday},1,4)
--------------------
SELECT substr(${yesterday}, 1, 4)

View File

@ -1,3 +1,12 @@
SELECT sum(ret_amount) AS '应收金额'
FROM test.test
GROUP BY a ORDER BY '应收金额' DESC;
--------------------
SELECT sum(ret_amount) AS "应收金额"
FROM test.test
GROUP BY a
ORDER BY "应收金额" DESC;
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS my_partitioned_table (
id INT,
name text,