[TYPO3-dev] Extbase builds wrong SQL with multiple LEFT JOIN?

Benjamin Beck BenjaminBeck at gmx.de
Tue Nov 15 11:06:20 CET 2011


Hello all,

i get a "column not found"-error by executing this constraint although tables and columns do exist:

<PHP>
...
$constraints[] = $query->logicalOr(
	$query->equals('authorHerausgeber.uid', $AID),
	$query->equals('mitauthorMitherausgeber.uid', $AID)
);
..
</PHP>

-->

<Uncaught TYPO3 Exception (Typo3 v. 4.5)>
#1247602160: Unknown column 'tx_gldataobjects_pub_mamhrsg_anwalt_mm.uid_foreign' in 'on clause': 

SELECT DISTINCT COUNT(*) FROM tx_gldataobjects_domain_model_publikation 

LEFT JOIN tx_gldataobjects_publikation_anwalt_mm 
	ON tx_gldataobjects_domain_model_publikation.uid = tx_gldataobjects_publikation_anwalt_mm.uid_local 
LEFT JOIN tx_gldataobjects_domain_model_anwalt 
	ON tx_gldataobjects_pub_mamhrsg_anwalt_mm.uid_foreign = tx_gldataobjects_domain_model_anwalt.uid 
LEFT JOIN tx_gldataobjects_pub_mamhrsg_anwalt_mm 
	ON tx_gldataobjects_domain_model_publikation.uid = tx_gldataobjects_pub_mamhrsg_anwalt_mm.uid_local 

WHERE (tx_gldataobjects_domain_model_anwalt.uid = '342' OR tx_gldataobjects_domain_model_anwalt.uid = '342') AND ... ;
</Uncaught TYPO3 Exception>



If i comment out any of the two constraints 
$query->equals('authorHerausgeber.uid', $AID)
$query->equals('mitauthorMitherausgeber.uid', $AID)
then the error goes away!

All Tables do exist. Google told me that there is a change in behaviour of mysql since 5.0.12 - but i am not sure if this is really my problem:
http://bugs.mysql.com/bug.php?id=15952



Has anyone experienced the same error?
Is this a known typo3 bug?
Has anyone a idea how to get around this without switching completely to plain sql?



Thanks
Benjamin


More information about the TYPO3-dev mailing list