summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-13 14:43:06 +0100
committerGitHub <noreply@github.com>2017-01-13 14:43:06 +0100
commit91beb178a7cf00749cdaab3c8eefa2536e53976d (patch)
tree7599473c9647b71d1fe7084909539b3d662121e8 /lib
parent622101f2dd43f618fa278976e38df8541f145bb6 (diff)
parent77b5d7bc864b32ced9c37dfb5e6fb606a5690b24 (diff)
downloadnextcloud-server-91beb178a7cf00749cdaab3c8eefa2536e53976d.tar.gz
nextcloud-server-91beb178a7cf00749cdaab3c8eefa2536e53976d.zip
Merge pull request #3051 from nextcloud/issue-2831-change-row-format-before-collation
Change the row-format before changing the collation
Diffstat (limited to 'lib')
-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 {