fix: 无GROUP BY聚合查询结果为空 — 跳过重复列投影
This commit is contained in:
Vendored
+1
-1
@@ -1458,7 +1458,7 @@ class QueryExecutor {
|
|||||||
const offset = stmt.offset ?? 0;
|
const offset = stmt.offset ?? 0;
|
||||||
const limit = stmt.limit ?? rows.length;
|
const limit = stmt.limit ?? rows.length;
|
||||||
rows = rows.slice(offset, offset + limit);
|
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));
|
rows = rows.map((row) => projectColumns(row, stmt.columns));
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1454,7 +1454,7 @@ class QueryExecutor {
|
|||||||
const offset = stmt.offset ?? 0;
|
const offset = stmt.offset ?? 0;
|
||||||
const limit = stmt.limit ?? rows.length;
|
const limit = stmt.limit ?? rows.length;
|
||||||
rows = rows.slice(offset, offset + limit);
|
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));
|
rows = rows.map((row) => projectColumns(row, stmt.columns));
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1460,7 +1460,7 @@
|
|||||||
const offset = stmt.offset ?? 0;
|
const offset = stmt.offset ?? 0;
|
||||||
const limit = stmt.limit ?? rows.length;
|
const limit = stmt.limit ?? rows.length;
|
||||||
rows = rows.slice(offset, offset + limit);
|
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));
|
rows = rows.map((row) => projectColumns(row, stmt.columns));
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -70,7 +70,7 @@ export class QueryExecutor {
|
|||||||
const offset = stmt.offset ?? 0;
|
const offset = stmt.offset ?? 0;
|
||||||
const limit = stmt.limit ?? rows.length;
|
const limit = stmt.limit ?? rows.length;
|
||||||
rows = rows.slice(offset, offset + limit);
|
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));
|
rows = rows.map((row) => projectColumns(row, stmt.columns));
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
|
|||||||
Reference in New Issue
Block a user