]> git.joonet.de Git - adminer.git/commitdiff
Avoid comma before PARTITION
authorJakub Vrana <jakub@vrana.cz>
Thu, 20 Nov 2014 17:53:52 +0000 (09:53 -0800)
committerJakub Vrana <jakub@vrana.cz>
Thu, 20 Nov 2014 17:53:52 +0000 (09:53 -0800)
adminer/drivers/mysql.inc.php

index 3ca7abb9e44fe8b25056e352d671483bb992bd42..9add20c870c317807058ba654a7f955ba324a619 100644 (file)
@@ -666,10 +666,9 @@ if (!defined("DRIVER")) {
                        . ($engine ? " ENGINE=" . q($engine) : "")
                        . ($collation ? " COLLATE " . q($collation) : "")
                        . ($auto_increment != "" ? " AUTO_INCREMENT=$auto_increment" : "")
-                       . $partitioning
                ;
                if ($table == "") {
-                       return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status");
+                       return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status$partitioning");
                }
                if ($table != $name) {
                        $alter[] = "RENAME TO " . table($name);
@@ -677,7 +676,7 @@ if (!defined("DRIVER")) {
                if ($status) {
                        $alter[] = ltrim($status);
                }
-               return $alter ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter)) : true;
+               return ($alter || $partitioning ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter) . $partitioning) : true);
        }
 
        /** Run commands to alter indexes