Improve functionality of limiting DROP DATABASE (bug #1456082).

This commit is contained in:
Michal Čihař
2006-04-27 11:35:54 +00:00
parent 4a4baf3a88
commit bfec931486
7 changed files with 88 additions and 78 deletions

View File

@@ -138,7 +138,7 @@ function confirmQuery(theForm1, sqlQuery1)
else {
// "DROP DATABASE" statement isn't allowed
if (noDropDbMsg != '') {
var drop_re = new RegExp('DROP\\s+(IF EXISTS\\s+)?DATABASE\\s', 'i');
var drop_re = new RegExp('(^|;)\\s*DROP\\s+(IF EXISTS\\s+)?DATABASE\\s', 'i');
if (drop_re.test(sqlQuery1.value)) {
alert(noDropDbMsg);
theForm1.reset();