diff options
author | Michal Čihař <michal@cihar.com> | 2004-08-16 15:02:50 +0400 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2004-08-16 15:02:50 +0400 |
commit | 95e3775b5e021cab6ab3c1dde685e52048abd27b (patch) | |
tree | 6e3f38b8b8b1c735442d2b1a0d2dc90fc9633e83 /read_dump.php | |
parent | 6873f7eed33a71ddb9e73886b88157118af831d4 (diff) |
Fix handling of comments -- and # (bug #1009494).
Diffstat (limited to 'read_dump.php')
-rw-r--r-- | read_dump.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/read_dump.php b/read_dump.php index 31d7d86d9e..ab976a1849 100644 --- a/read_dump.php +++ b/read_dump.php @@ -241,7 +241,7 @@ if ($sql_query != '') { if ($pieces_count == 1 && !empty($pieces[0]['query'])) { $sql_query = $pieces[0]['query']; // .*? bellow is non greedy expansion, just in case somebody wants to understand it... - if (preg_match('@^((-- |#)^[\n]*|/\*.*?\*/)*(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $sql_query)) { + if (preg_match('@^((-- |#)[^\n]*\n|/\*.*?\*/)*(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $sql_query)) { $reload = 1; } require('./sql.php'); @@ -261,7 +261,8 @@ if ($sql_query != '') { $a_sql_query = $pieces[$i]['query']; // .*? bellow is non greedy expansion, just in case somebody wants to understand it... - if ($i == $count - 1 && preg_match('@^((-- |#)^[\n]*|/\*.*?\*/)*(SELECT|SHOW)@i', $a_sql_query)) { + echo "<pre>$a_sql_query</pre>"; + if ($i == $count - 1 && preg_match('@^((-- |#)[^\n]*\n|/\*.*?\*/)*(SELECT|SHOW)@i', $a_sql_query)) { $complete_query = $sql_query; $display_query = $sql_query; $sql_query = $a_sql_query; |