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:
+4
-2
@@ -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') {
|
||||||
|
|||||||
Reference in New Issue
Block a user