Project

General

Profile

Actions

Bug #72036

closed

Install tool RENAME of table columns fails with adodb (postgresql)

Added by Lars Peter Søndergaard almost 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Start date:
2015-12-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
postgresql
Complexity:
Is Regression:
No
Sprint Focus:

Description

When using PostgreSQL, running the Database Analyzer and it suggests to rename a couple of columns, e.g. ALTER TABLE foobar RENAME zzz_deleted_foobar;.

This fails with the following exception:

Uncaught TYPO3 Exception
#1: PHP Warning: Invalid argument supplied for foreach() in /var/www/pgsql/typo3_src-7.6.0/typo3/sysext/adodb/adodb/adodb-datadict.inc.php line 377 (More information)

TYPO3\CMS\Core\Error\Exception thrown in file
/var/www/pgsql/typo3_src-build/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 111.

14 TYPO3\CMS\Core\Error\ErrorHandler::handleError(2, "Invalid argument supplied for foreach()", "/var/www/pgsql/typo3_src-7.6.0/typo3/sysext/adodb/adodb/adodb-datadict.inc.php", 377, array)

/var/www/pgsql/typo3_src-7.6.0/typo3/sysext/adodb/adodb/adodb-datadict.inc.php:
00375:   $conn = $this->connection;
00376:   $saved = $conn->debug;
00377:   foreach($sql as $line) {
00378: 
00379:    if ($this->debug) $conn->debug = true;

13 ADODB_DataDict::ExecuteSQLArray("")

/var/www/pgsql/typo3_src-build/typo3/sysext/dbal/Classes/Database/DatabaseConnection.php:
03042:                         break;
03043:                     default:
03044:                         $result = $this->handlerInstance[$this->lastHandlerKey]->DataDictionary->ExecuteSQLArray($compiledQuery);
03045:                 }
03046:                 break;

12 TYPO3\CMS\Dbal\Database\DatabaseConnection::admin_query("ALTER TABLE index_config RENAME zzz_deleted_index_config;")

/var/www/pgsql/typo3_src-build/typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php:
00645:             foreach ($arr as $key => $string) {
00646:                 if (isset($keyArr[$key]) && $keyArr[$key]) {
00647:                     $res = $databaseConnection->admin_query($string);
00648:                     if ($res === false) {
00649:                         $result[$key] = $databaseConnection->sql_error();

11 TYPO3\CMS\Install\Service\SqlSchemaMigrationService::performUpdateQueries(array, array)

[...]

I took a look and found that the function \TYPO3\CMS\Dbal\Database\SqlCompilers\Adodb::compileALTERTABLE is being called with $components['action'] set to 'RENAME', which is not handled in that function.

Actions

Also available in: Atom PDF