Skip to content

Commit 4d1d2fe

Browse files
authored
Merge pull request #15960 from uberbrady/improve_restore_cleaner_utf8
2 parents ab6363a + a0e7dcf commit 4d1d2fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Console/Commands/RestoreFromBackup.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function parse_sql(string $line): string {
5151
/* we *could* have made the ^INSERT INTO blah VALUES$ turn on the capturing state, and closed it with
5252
a ^(blahblah);$ but it's cleaner to not have to manage the state machine. We're just going to
5353
assume that (blahblah), or (blahblah); are values for INSERT and are always acceptable. */
54+
"<^/\*!40101 SET NAMES '?[a-zA-Z0-9_-]+'? \*/;$>" => false, //using weird delimiters (<,>) for readability. allow quoted or unquoted charsets
55+
"<^/\*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' \*/;$>" => false, //same, now handle zero-values
5456
];
5557

5658
foreach($allowed_statements as $statement => $statechange) {

0 commit comments

Comments
 (0)