Ignore comments for SQL splitting, otherwise unmatched quotes cause problems (bug #978113).
This commit is contained in:
@@ -8,6 +8,8 @@ $Source$
|
|||||||
2004-06-24 Michal Čihař <michal@cihar.com>
|
2004-06-24 Michal Čihař <michal@cihar.com>
|
||||||
* main.php, changelog.php: Add headers to ChangeLog display.
|
* main.php, changelog.php: Add headers to ChangeLog display.
|
||||||
* scripts/create_tables.sql: Add IF EXISTS.
|
* scripts/create_tables.sql: Add IF EXISTS.
|
||||||
|
* libraries/read_dump.lib.php: Ignore comments for SQL splitting,
|
||||||
|
otherwise unmatched quotes cause problems (bug #978113).
|
||||||
|
|
||||||
2004-06-23 Marc Delisle <lem9@users.sourceforge.net>
|
2004-06-23 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* many files: remove references to older /images, and
|
* many files: remove references to older /images, and
|
||||||
|
@@ -69,6 +69,16 @@ function PMA_splitSqlFile(&$ret, $sql, $release)
|
|||||||
} // end if...elseif...else
|
} // end if...elseif...else
|
||||||
} // end for
|
} // end for
|
||||||
} // end if (in string)
|
} // end if (in string)
|
||||||
|
|
||||||
|
// let's skip c style comments
|
||||||
|
else if ($char == '/' && $sql[$i + 1] == '*') {
|
||||||
|
$i = strpos($sql, '*/', $i) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// lets skip ANSI comments
|
||||||
|
else if ($char == '-' && $sql[$i + 1] == '-' && $sql[$i + 2] <= ' ') {
|
||||||
|
$i = strpos($sql, "\n", $i);
|
||||||
|
}
|
||||||
|
|
||||||
// We are not in a string, first check for delimiter...
|
// We are not in a string, first check for delimiter...
|
||||||
else if ($char == ';') {
|
else if ($char == ';') {
|
||||||
@@ -90,12 +100,6 @@ function PMA_splitSqlFile(&$ret, $sql, $release)
|
|||||||
$string_start = $char;
|
$string_start = $char;
|
||||||
} // end else if (is start of string)
|
} // end else if (is start of string)
|
||||||
|
|
||||||
// ... and finally disactivate the "/*!...*/" syntax if MySQL < 3.22.07
|
|
||||||
else if ($release < 32270
|
|
||||||
&& ($char == '!' && $i > 1 && $sql[$i-2] . $sql[$i-1] == '/*')) {
|
|
||||||
$sql[$i] = ' ';
|
|
||||||
} // end else if
|
|
||||||
|
|
||||||
// loic1: send a fake header each 30 sec. to bypass browser timeout
|
// loic1: send a fake header each 30 sec. to bypass browser timeout
|
||||||
$time1 = time();
|
$time1 = time();
|
||||||
if ($time1 >= $time0 + 30) {
|
if ($time1 >= $time0 + 30) {
|
||||||
|
Reference in New Issue
Block a user