Skip to content

Commit

Permalink
Backupdb: Fix when last insertion to a table is ephemeral.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 22, 2023
1 parent e826a26 commit f313c14
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions batch/backupdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,9 @@ private function process_line($s, $line) {
++$p;
}
if ($p === $l) {
break;
} else if ($ch === "(") {
$ch = "";
}
if ($ch === "(") {
if (!preg_match('/\G\((?:[^\\\\\')]|\'(?:[^\\\\\']|\\\\.)*+\')*+\)/s', $s, $m, 0, $p)) {
break;
}
Expand All @@ -541,10 +542,12 @@ private function process_line($s, $line) {
}
++$p;
continue;
} else if ($ch === ";") {
if ($this->_separator === "") {
$this->fwrite(";");
}
}
if ($this->_separator === "" || $this->_separator === ",\n") {
// have inserted
$this->fwrite($ch === ";" ? ";" : ";\n");
}
if ($ch === ";") {
++$p;
}
$this->_inserting = null;
Expand Down

0 comments on commit f313c14

Please sign in to comment.