Optimize parser
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@710 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
d886b00a52
commit
718ac02286
|
@ -6,6 +6,7 @@ if (!$error && $_POST) {
|
|||
if (is_string($query = (isset($_POST["file"]) ? get_file("sql_file") : $_POST["query"]))) {
|
||||
@set_time_limit(0);
|
||||
$query = str_replace("\r", "", $query);
|
||||
$query = rtrim($query);
|
||||
if (strlen($query) && $history[count($history) - 1] != $query) {
|
||||
$history[] = $query;
|
||||
}
|
||||
|
@ -17,7 +18,7 @@ if (!$error && $_POST) {
|
|||
if (is_object($dbh2)) {
|
||||
$dbh2->select_db($_GET["db"]);
|
||||
}
|
||||
while (rtrim($query)) {
|
||||
while (strlen($query)) {
|
||||
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
|
||||
$delimiter = $match[1];
|
||||
$query = substr($query, strlen($match[0]));
|
||||
|
|
Loading…
Reference in a new issue