fix: AUTO_INCREMENT error when only exporting table structure in database-level exports; issue #14066

Signed-off-by: Xinyu Liu <meteor.lxy@foxmail.com>
(cherry picked from commit f1fa924f5f)
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Xinyu Liu 2018-03-24 09:19:57 +00:00 committed by Maurício Meneghini Fauth
parent e1519d2414
commit f262c8cd7a

View File

@ -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;