fix: 无GROUP BY聚合查询结果为空 — 跳过重复列投影
CI / test (18.x) (push) Waiting to run
CI / test (20.x) (push) Waiting to run
CI / test (22.x) (push) Waiting to run
CI / test (24.x) (push) Waiting to run

This commit is contained in:
thzxx
2026-07-26 17:46:14 +08:00
parent 5068cd0409
commit 382e1b24fe
8 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -1458,7 +1458,7 @@ class QueryExecutor {
const offset = stmt.offset ?? 0;
const limit = stmt.limit ?? rows.length;
rows = rows.slice(offset, offset + limit);
if (!hasGroupBy && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
if (!hasGroupBy && !hasAggregate && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
rows = rows.map((row) => projectColumns(row, stmt.columns));
}
return rows;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1454,7 +1454,7 @@ class QueryExecutor {
const offset = stmt.offset ?? 0;
const limit = stmt.limit ?? rows.length;
rows = rows.slice(offset, offset + limit);
if (!hasGroupBy && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
if (!hasGroupBy && !hasAggregate && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
rows = rows.map((row) => projectColumns(row, stmt.columns));
}
return rows;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1460,7 +1460,7 @@
const offset = stmt.offset ?? 0;
const limit = stmt.limit ?? rows.length;
rows = rows.slice(offset, offset + limit);
if (!hasGroupBy && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
if (!hasGroupBy && !hasAggregate && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
rows = rows.map((row) => projectColumns(row, stmt.columns));
}
return rows;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -70,7 +70,7 @@ export class QueryExecutor {
const offset = stmt.offset ?? 0;
const limit = stmt.limit ?? rows.length;
rows = rows.slice(offset, offset + limit);
if (!hasGroupBy && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
if (!hasGroupBy && !hasAggregate && stmt.columns.length > 0 && stmt.columns[0] !== '*') {
rows = rows.map((row) => projectColumns(row, stmt.columns));
}
return rows;