From f262c8cd7aff663c9339cc498a3580b4fe11cbd6 Mon Sep 17 00:00:00 2001 From: Xinyu Liu Date: Sat, 24 Mar 2018 09:19:57 +0000 Subject: [PATCH] fix: AUTO_INCREMENT error when only exporting table structure in database-level exports; issue #14066 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Xinyu Liu (cherry picked from commit f1fa924f5f545d88b5c34500283ff5de12f6a9e5) Signed-off-by: MaurĂ­cio Meneghini Fauth --- libraries/classes/Plugins/Export/ExportSql.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/classes/Plugins/Export/ExportSql.php b/libraries/classes/Plugins/Export/ExportSql.php index d9a9f6d82b..40c202271f 100644 --- a/libraries/classes/Plugins/Export/ExportSql.php +++ b/libraries/classes/Plugins/Export/ExportSql.php @@ -1772,8 +1772,13 @@ class ExportSql extends ExportPlugin if (isset($GLOBALS['sql_auto_increment']) && ($statement->entityOptions->has('AUTO_INCREMENT') !== false) ) { - $sql_auto_increments_query .= ', AUTO_INCREMENT=' - . $statement->entityOptions->has('AUTO_INCREMENT'); + if (!isset($GLOBALS['table_data']) + || (isset($GLOBALS['table_data']) + && in_array($table, $GLOBALS['table_data'])) + ) { + $sql_auto_increments_query .= ', AUTO_INCREMENT=' + . $statement->entityOptions->has('AUTO_INCREMENT'); + } } $sql_auto_increments_query .= ';' . $crlf;