Merge pull request #1344 from smita786/QA_4_2

fix bug #4487
This commit is contained in:
Marc Delisle 2014-08-27 12:52:14 -04:00
commit ebf07e8131

View File

@ -1481,13 +1481,18 @@ class ExportSql extends ExportPlugin
// that could be there starting with MySQL 5.0.24
// in Drizzle it's useless as it contains the value given at table
// creation time
$schema_create = preg_replace(
'/AUTO_INCREMENT\s*=\s*([0-9])+/',
'',
$schema_create
);
$schema_create .= ($compat != 'MSSQL') ? $auto_increment : '';
if (preg_match('/AUTO_INCREMENT\s*=\s*([0-9])+/', $schema_create)) {
if ($compat == 'MSSQL' || $auto_increment == '') {
$auto_increment = ' ';
}
$schema_create = preg_replace(
'/\sAUTO_INCREMENT\s*=\s*([0-9])+\s/',
$auto_increment,
$schema_create
);
} else {
$schema_create .= ($compat != 'MSSQL') ? $auto_increment : '';
}
$GLOBALS['dbi']->freeResult($result);
return $schema_create . ($add_semicolon ? ';' . $crlf : '');