1 parent
a9194ba3b5
commit
86dcc75fa0
3 files changed
+49
-1
No files matched your search
@@ -309,6 +309,11 @@ describe("splitSqlStatementRanges", () => {
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges(sql, "kingbase"))).toEqual(["SELECT * FROM yd_org_decla_detail WHERE clr_ym = #{ym}", "SELECT 2"]);
|
||||
});
|
||||
|
||||
it("keeps dotted MyBatis placeholders instead of treating them as hash comments", () => {
|
||||
const sql = "SELECT * FROM users WHERE id = #{params.user.id};\nSELECT 2";
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges(sql, "mysql"))).toEqual(["SELECT * FROM users WHERE id = #{params.user.id}", "SELECT 2"]);
|
||||
});
|
||||
|
||||
it("treats malformed or disabled MyBatis prefixes as hash comments", () => {
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges("SELECT 1; #{1ym};\nSELECT 2", "kingbase"))).toEqual(["SELECT 1", "SELECT 2"]);
|
||||
expect(rangeSqlTexts(splitSqlStatementRanges("SELECT 1; #{ym};\nSELECT 2", "kingbase", { enabledSyntaxes: ["shell"] }))).toEqual(["SELECT 1", "SELECT 2"]);
|
||||
|
||||
Reference in new issue
Block a user