[BUGFIX] DBAL: Repair AUTO_INCREMENT 83/35183/5
authorAndreas Fernandez <andreas.fernandez@aspedia.de>
Tue, 9 Dec 2014 11:05:21 +0000 (12:05 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Thu, 22 Jan 2015 20:54:02 +0000 (21:54 +0100)
This patch fixes the creation of fields with an AUTO_INCREMENT flag,
especially for DBMS that don't have built-in support for AI flags.

Resolves: #63705
Releases: master, 6.2
Change-Id: I7ebf743e0e0483af181b76f66a8cf158ebe775cc
Reviewed-on: http://review.typo3.org/35183
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/dbal/Classes/Database/SqlParser.php

index 6dde6be..bafa6e2 100644 (file)
@@ -393,11 +393,11 @@ class SqlParser extends \TYPO3\CMS\Core\Database\SqlParser {
                                        foreach ($fieldCfg['featureIndex'] as $feature => $featureDef) {
                                                switch (TRUE) {
                                                        case $feature === 'UNSIGNED' && !$this->databaseConnection->runningADOdbDriver('mysql'):
-
-                                                       case $feature === 'AUTO_INCREMENT':
-
                                                        case $feature === 'NOTNULL' && $this->databaseConnection->runningADOdbDriver('oci8'):
                                                                continue;
+                                                       case $feature === 'AUTO_INCREMENT':
+                                                               $cfg .= ' AUTOINCREMENT';
+                                                               break;
                                                        case $feature === 'NOTNULL':
                                                                $cfg .= ' NOTNULL';
                                                                break;