]> source.dussan.org Git - nextcloud-server.git/commitdiff
Change the row-format before changing the collation 3063/head
authorJoas Schilling <coding@schilljs.com>
Thu, 12 Jan 2017 15:54:29 +0000 (16:54 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 13 Jan 2017 13:35:02 +0000 (14:35 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Repair/Collation.php

index 54de1a719bd2289b51bb35c93b78699a703d016e..a3535fb33a296969ef91917feb08da8eab4e3cb8 100644 (file)
@@ -75,6 +75,18 @@ class Collation implements IRepairStep {
 
                $tables = $this->getAllNonUTF8BinTables($this->connection);
                foreach ($tables as $table) {
+                       $output->info("Change row format for $table ...");
+                       $query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT = DYNAMIC;');
+                       try {
+                               $query->execute();
+                       } catch (DriverException $e) {
+                               // Just log this
+                               $this->logger->logException($e);
+                               if (!$this->ignoreFailures) {
+                                       throw $e;
+                               }
+                       }
+
                        $output->info("Change collation for $table ...");
                        $query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET ' . $characterSet . ' COLLATE ' . $characterSet . '_bin;');
                        try {