fix(sqlserver): preserve temporary table names in statement ranges
This commit is contained in:
2 files changed
+44
-34
No files matched your search
@@ -281,6 +281,11 @@ describe("splitSqlStatementRanges", () => {
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges(sql))).toEqual(["SELECT 1", "SELECT 2"]);
|
||||
});
|
||||
|
||||
it("keeps SQL Server temporary table names instead of treating them as hash comments", () => {
|
||||
const sql = "DROP TABLE IF EXISTS #Temp;\nSELECT * FROM ##GlobalTemp;";
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges(sql, "sqlserver"))).toEqual(["DROP TABLE IF EXISTS #Temp", "SELECT * FROM ##GlobalTemp"]);
|
||||
});
|
||||
|
||||
it("keeps MyBatis placeholders instead of treating them as hash comments", () => {
|
||||
const sql = "SELECT * FROM yd_org_decla_detail WHERE clr_ym = #{ym};\nSELECT 2";
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges(sql, "kingbase"))).toEqual(["SELECT * FROM yd_org_decla_detail WHERE clr_ym = #{ym}", "SELECT 2"]);
|
||||
|
||||
Reference in new issue
Block a user