adminer
adminer copied to clipboard
Fixed string constants and queries splitting.
\ at the end of string constants breaks string/query splitting. Here is the test:
-- \ at the end of strting query splitting
SELECT 'some''', '\', ';';
SELECT E'some\'', E'\\', E';';
SELECT 'some''', '\', ';', E'some\'', E'\\', E';';
SELECT E'some\'', E'\\', E';', 'some''', '\', ';';
Thanks for sharing, but your fix contains several problems:
- C-style escapes depends on SQL dialect and server settings.
- String constants letter
Eis PostgreSQL specific and is case-insensitive. - Added
"[^']"rule works only for single quotes, but main cycle detects various types of string quotes.
Here you can find a solution for MySQL and PostgreSQL based on your work (if you are interested): https://github.com/pematon/adminer/commit/aa519b78ca88895cacc8dec0de0fe3c00125b428
Thanks.