Skip to content

Commit

Permalink
Fixes to 'clean' mode to better handle character sets and zero-values
Browse files Browse the repository at this point in the history
  • Loading branch information
uberbrady committed Dec 12, 2024
1 parent 5014a95 commit a0e7dcf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Console/Commands/RestoreFromBackup.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public function parse_sql(string $line): string {
/* we *could* have made the ^INSERT INTO blah VALUES$ turn on the capturing state, and closed it with
a ^(blahblah);$ but it's cleaner to not have to manage the state machine. We're just going to
assume that (blahblah), or (blahblah); are values for INSERT and are always acceptable. */
"<^/\*!40101 SET NAMES '?[a-zA-Z0-9_-]+'? \*/;$>" => false, //using weird delimiters (<,>) for readability. allow quoted or unquoted charsets
"<^/\*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' \*/;$>" => false, //same, now handle zero-values
];

foreach($allowed_statements as $statement => $statechange) {
Expand Down

0 comments on commit a0e7dcf

Please sign in to comment.