Issue Bug Closed

#38406Extension Import not working with postgresql and DBAL

Gerald Buttinger 06/26/12, 15:59 updated 10/02/18, 12:17

Description

the import of extensions is not working completely with DBAL on postgresql.

the problem lies in the function “insertLastVersion” in the file:
”/typo3/sysext/em/classes/database/class.tx_em_database.php”

on line 220, the following code:

$groupedRows = $GLOBALS[‘TYPO3_DB’]->exec_SELECTgetRows(
‘extkey, version, max(intversion) maxintversion’,
‘cache_extensions’,
‘repository=’ . intval($repositoryUid),
‘extkey’
);

… results in the following SQL-statement:

SELECT “extkey”, “version”, max(“intversion”) “maxintversion” FROM “cache_extensions” WHERE “repository” = 1 GROUP BY “extkey”

this is not valid in postgres due to:
1. “as” missing between max(“intversion”) and “maxintversion“
2. “version” missing from the group-clause

thus, the code must be changed to the following:

$groupedRows = $GLOBALS[‘TYPO3_DB’]->exec_SELECTgetRows(
‘extkey, version, max(intversion) as maxintversion’,
‘cache_extensions’,
‘repository=’ . intval($repositoryUid),
‘extkey, version’
);

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.