Project

General

Profile

Actions

Bug #21784

closed

ORA-00918: column ambiguously defined

Added by Xavier Perseguers almost 15 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-12-03
Due date:
% Done:

0%

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

Description

When using DBAL and trying to use function menu "Indexed Search" from Web > Info, this error is raised.

Analyzing the problem is related to the way a query is constructed in modfunc1/class.tx_indexedsearch_modfunc1.php:

$res = $GLOBALS['TYPO3_DB']->execSELECTquery(
'ISEC.*, IP.*, count(*) AS count_val',
'index_phash IP, index_section ISEC',
...

Problem is that both index_phash and index_section contains a column with same name (that is btw used for joining them together), column phash. This results in an invalid query when using DBAL because this query uses a LIMIT to restrict the number of rows returned and the limit is handled by AdoDB by encapsulating the query into another one:

SELECT * FROM (SELECT ISEC.*, ...) WHERE rownum <= 101

And this causes the ORA-00918 error.

Solution:

Don't use .* but list needed columns. Note: this is a quick hack for this very query. In general explicitly listing all columns, even if "not fun" should be done to ensure mapping may apply to fields and to prevent those bugs.

(issue imported from #M12903)


Files

12903.diff (1.11 KB) 12903.diff Administrator Admin, 2009-12-03 12:08
Actions

Also available in: Atom PDF