Only treat --full as the option when it is outside string literals

A value like 'value --full' in the query turned the full table view on.
Leave string literals and quoted identifiers out when looking for the
option.
This commit is contained in:
2026-09-30 17:34:49 +02:00
parent 266b5a6985
commit 839572f1fb
+4 -2
View File
@@ -356,8 +356,10 @@
askDeleteConfirmation(term, sql, response.error); askDeleteConfirmation(term, sql, response.error);
return; return;
} }
// "--full" is a plain SQL comment, so the database ignores it // "--full" is a plain SQL comment, so the database ignores it; string
renderSqlResponse(term, response, /(^|\s)-- ?full\b/.test(sql)); // literals are left out so a value containing it doesn't count
var withoutStrings = sql.replace(/'(?:[^']|'')*'/g, "''").replace(/"(?:[^"]|"")*"/g, '""');
renderSqlResponse(term, response, /(^|\s)-- ?full\b/.test(withoutStrings));
term.resume(); term.resume();
}).fail(function (xhr, status) { }).fail(function (xhr, status) {
if (status === 'timeout') { if (status === 'timeout') {