Skip to content

fix: PostgreSQL dollar-tag detection inside quoted strings#1028

Open
Kovania wants to merge 1 commit intoantares-sql:masterfrom
Kovania:master
Open

fix: PostgreSQL dollar-tag detection inside quoted strings#1028
Kovania wants to merge 1 commit intoantares-sql:masterfrom
Kovania:master

Conversation

@Kovania
Copy link
Copy Markdown

@Kovania Kovania commented Jan 26, 2026

Problem

The querySplitter function incorrectly parsed $ characters inside single-quoted strings as PostgreSQL dollar-quoted tag delimiters. This caused queries with bcrypt hashes (e.g., '$2b$12$...') or any string containing $ to fail with syntax errors.

Solution

Modified the dollar-tag detection logic to only trigger when outside regular quoted strings ('...'). Dollar-tags are now correctly ignored when inside string literals, while still properly handling legitimate PostgreSQL dollar-quoted blocks like $function$...$function$.

Example of fixed query

UPDATE player SET password = '$2b$12$p74VOtx8skceVEFSvRdo7eGcQU5L/c9yHb3jRJ05XesMEw53/wdiC';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant