Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix backslash escape handling in SQL string literals with performance optimization#2335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Copilot wants to merge11 commits intodevelop
base:develop
Choose a base branch
Loading
fromcopilot/fix-ascii-escapes
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
11 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Add tests for edge case: escaped backslash followed by escaped quote
Added comprehensive tests to verify the parser correctly handles the edge case where an escaped backslash is followed by an escaped quote. The implementation correctly processes '\\'  (backslash + quote using SQL quote doubling) and '\\\\'  (two backslashes + quote).Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
  • Loading branch information
@mathiasrw
Copilot andmathiasrw committedDec 12, 2025
commit3e12c424ebd468a6fc55cd634d8c1e08fb227e70
21 changes: 21 additions & 0 deletionstest/test489.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,4 +18,25 @@ describe('Test 489 - ASCII with backslash character', function () {
var res = alasql("VALUE OF SELECT '\\\\'");
assert.equal(res, '\\');
});

it('D) Escaped backslash followed by escaped quote (edge case)', function () {
// In SQL: '\\'' means backslash followed by quote
// \\ = one backslash, '' = one quote (SQL quote doubling)
var res = alasql("VALUE OF SELECT '\\\\'''");
assert.equal(res.length, 2);
assert.equal(res.charCodeAt(0), 92); // backslash
assert.equal(res.charCodeAt(1), 39); // quote
assert.equal(res, "\\'");
});

it('E) Multiple backslashes followed by quote', function () {
// In SQL: '\\\\'' means two backslashes followed by quote
// \\\\ = two backslashes, '' = one quote
var res = alasql("VALUE OF SELECT '\\\\\\\\'''");
assert.equal(res.length, 3);
assert.equal(res.charCodeAt(0), 92); // backslash
assert.equal(res.charCodeAt(1), 92); // backslash
assert.equal(res.charCodeAt(2), 39); // quote
assert.equal(res, "\\\\'");
});
});
Loading

[8]ページ先頭

©2009-2025 Movatter.jp