public function getAutoIncrement($tableName)
    {
        if (!$this->isTableNameAllowed($tableName)) {
            throw new \InvalidArgumentException(
                'The given table name is invalid. This means it is either empty or not in the list of allowed tables.',
                1334439567
            );
        }

        \Tx_Phpunit_Service_Database::enableQueryLogging();
        $dbResult = \Tx_Phpunit_Service_Database::getDatabaseConnection()->sql_query(
            'SHOW TABLE STATUS WHERE Name = \'' . $tableName . '\';'
        );
        if (!$dbResult) {
            throw new \Tx_Phpunit_Exception_Database(1334439578);
        }

        /** @var array $row */
        $row = \Tx_Phpunit_Service_Database::getDatabaseConnection()->sql_fetch_assoc($dbResult);
        \Tx_Phpunit_Service_Database::getDatabaseConnection()->sql_free_result($dbResult);

        $autoIncrement = $row['Auto_increment'];
        if ($autoIncrement === null) {
            throw new \InvalidArgumentException(
                'The given table name is invalid. This means it is either empty or not in the list of allowed tables.',
                1334439584
            );
        }

        return (int)$autoIncrement;
    }
public function getAutoIncrement($tableName)
    {
        if (!$this->isTableNameAllowed($tableName)) {
            throw new \InvalidArgumentException(
                'The given table name is invalid. This means it is either empty or not in the list of allowed tables.',
                1334439567
            );
        }

        \Tx_Phpunit_Service_Database::enableQueryLogging();
        $dbResult = \Tx_Phpunit_Service_Database::getDatabaseConnection()->sql_query(
            'SHOW TABLE STATUS WHERE Name = \'' . $tableName . '\';'
        );
        if (!$dbResult) {
            throw new \Tx_Phpunit_Exception_Database(1334439578);
        }

        /** @var array $row */
        $row = \Tx_Phpunit_Service_Database::getDatabaseConnection()->sql_fetch_assoc($dbResult);
        \Tx_Phpunit_Service_Database::getDatabaseConnection()->sql_free_result($dbResult);

        $autoIncrement = $row['Auto_increment'];
        if ($autoIncrement === null) {
            throw new \InvalidArgumentException(
                'The given table name is invalid. This means it is either empty or not in the list of allowed tables.',
                1334439584
            );
        }

        return (int)$autoIncrement;
    }
public function getAutoIncrement ( $ tableName ) { if ( ! $ this -> isTableNameAllowed ( $ tableName ) ) { throw new \ InvalidArgumentException ( 'The given table name is invalid. This means it is either empty or not in the list of allowed tables.' , 1334439567 ) ; } \ Tx_Phpunit_Service_Database :: enableQueryLogging ( ) ; $ dbResult = \ Tx_Phpunit_Service_Database :: getDatabaseConnection ( ) -> sql_query ( 'SHOW TABLE STATUS WHERE Name = \'' . $ tableName . '\';' ) ; if ( ! $ dbResult ) { throw new \ Tx_Phpunit_Exception_Database ( 1334439578 ) ; } /** @var array $row */ $ row = \ Tx_Phpunit_Service_Database :: getDatabaseConnection ( ) -> sql_fetch_assoc ( $ dbResult ) ; \ Tx_Phpunit_Service_Database :: getDatabaseConnection ( ) -> sql_free_result ( $ dbResult ) ; $ autoIncrement = $ row [ 'Auto_increment' ] ; if ( $ autoIncrement === null ) { throw new \ InvalidArgumentException ( 'The given table name is invalid. This means it is either empty or not in the list of allowed tables.' , 1334439584 ) ; } return ( int ) $ autoIncrement ; }
Reads the current auto increment value for a given table.

This function is only valid for tables that actually have an auto
increment value.

@param string $tableName
the name of the table for which the auto increment value should be
retrieved, must not be empty

@return int
the current auto_increment value of table $tableName, will be > 0

@throws \InvalidArgumentException
@throws \Tx_Phpunit_Exception_Database
Reads the current auto increment value for a given table .