From: Jakub Vrana Date: Thu, 20 Nov 2014 17:53:52 +0000 (-0800) Subject: Avoid comma before PARTITION X-Git-Tag: v4.2.0~15 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=4a4e58179fb2fcd88f6296bdc82029cd901c6af3;p=adminer.git Avoid comma before PARTITION --- diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 3ca7abb9..9add20c8 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -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