fix: avoid derived table wrapping for SQL Server TOP pagination

Replace derived table wrapping with direct TOP injection for SQL Server
to prevent error 8155 when inner SELECT produces unnamed columns (e.g.
SELECT @@version). Also preserves ORDER BY that was incorrectly stripped
by the previous approach.
This commit is contained in:
t8y2 committed 2026-05-25 11:28:02 +08:00
1 parent 67572cd685
commit e5e86eda30
6 files changed
+143 -123

No files matched your search

@@ -5,5 +5,5 @@ import test from "node:test";
const source = readFileSync("apps/desktop/src/components/editor/QueryEditor.vue", "utf8");
test("query editor requests a fresh CodeMirror measure after live zoom updates", () => {
assert.match(source, /requestMeasure\(\)/);
assert.match(source, /syncEditorFontCssVars/);
});
+1 -1
View File
@@ -341,7 +341,7 @@ test("suggests SQL snippets for common abbreviations", () => {
const snippet = items.find((item) => item.type === "snippet" && item.label === "select *");
assert.ok(snippet);
assert.equal(snippet.apply, "SELECT *\nFROM ${table}\nLIMIT 100;");
assert.equal(snippet.apply, "SELECT *\nFROM table\nLIMIT 100;");
});
test("suggests DATE_FORMAT as parameter snippet", () => {