summaryrefslogtreecommitdiffstats
path: root/lib/private/Repair
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-12 16:54:29 +0100
committerJoas Schilling <coding@schilljs.com>2017-01-12 16:54:29 +0100
commit77b5d7bc864b32ced9c37dfb5e6fb606a5690b24 (patch)
tree2ed2891c3f895ba477500d49745e7780c7e28ae2 /lib/private/Repair
parent00c3f807db59f69cac37429f1b4be424720371e3 (diff)
downloadnextcloud-server-77b5d7bc864b32ced9c37dfb5e6fb606a5690b24.tar.gz
nextcloud-server-77b5d7bc864b32ced9c37dfb5e6fb606a5690b24.zip
Change the row-format before changing the collation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Repair')
-rw-r--r--lib/private/Repair/Collation.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php
index 54de1a719bd..a3535fb33a2 100644
--- a/lib/private/Repair/Collation.php
+++ b/lib/private/Repair/Collation.php
@@ -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 {