Fix handling of comments -- and # (bug #1009494).
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2004-08-16 Michal Čihař <michal@cihar.com>
|
||||||
|
* read_dump.php: Fix handling of comments -- and # (bug #1009494).
|
||||||
|
|
||||||
2004-08-15 Marc Delisle <lem9@users.sourceforge.net>
|
2004-08-15 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
(Patches from Michael Keck)
|
(Patches from Michael Keck)
|
||||||
* left.php, queryframe.php, themes.php: bug #1005479: was using
|
* left.php, queryframe.php, themes.php: bug #1005479: was using
|
||||||
|
@@ -241,7 +241,7 @@ if ($sql_query != '') {
|
|||||||
if ($pieces_count == 1 && !empty($pieces[0]['query'])) {
|
if ($pieces_count == 1 && !empty($pieces[0]['query'])) {
|
||||||
$sql_query = $pieces[0]['query'];
|
$sql_query = $pieces[0]['query'];
|
||||||
// .*? bellow is non greedy expansion, just in case somebody wants to understand it...
|
// .*? 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;
|
$reload = 1;
|
||||||
}
|
}
|
||||||
require('./sql.php');
|
require('./sql.php');
|
||||||
@@ -261,7 +261,8 @@ if ($sql_query != '') {
|
|||||||
$a_sql_query = $pieces[$i]['query'];
|
$a_sql_query = $pieces[$i]['query'];
|
||||||
|
|
||||||
// .*? bellow is non greedy expansion, just in case somebody wants to understand it...
|
// .*? 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;
|
$complete_query = $sql_query;
|
||||||
$display_query = $sql_query;
|
$display_query = $sql_query;
|
||||||
$sql_query = $a_sql_query;
|
$sql_query = $a_sql_query;
|
||||||
|
Reference in New Issue
Block a user