Read data relation query errors

em emmexx 29 Mar, 2021
Some of my queries stopped working after updating CCv6. After debugging them in phpmyadmin I found out that CC builds those queries wrong.
​
CC 6.0.7
Read data with a table t1 and a relation to a table t2.
t2 is set as "One matching record, foreign key in this table"
Foreign key is the field name of t2 related to a t1 field, not the primary key.
My t2.foreign key is not related to t1 primary key but to another t1 field. So I added a relation conditions:
T2.myforeignkey:T1.mykey
​
The query created was (probably wrong):
Select ... FROM T1
LEFT JOIN T2 on t1.mykey = T2.myforeignkey
​
As you can see the join between t1 primary key and t2 foreign key is missing. But the query worked for me.
​
CC 6.0.12
Read Data is the same as before but the query is different:
​
Select ... FROM T1
LEFT JOIN T2 on t1.primarykey = T2.myforeignkey
​
Now my additional relation is missing, and the (correct) join between primarykey and foreignkey is preventing the query from giving back any result.
​
My bad for using a bug to get a result but the latest version of CC is not right yet.
​
bye
maxx
This topic is locked and no more replies can be posted.