Feature #21560
closed
sql_query does not respect "mapping"
Added by Steffen Ritter about 15 years ago.
Updated almost 15 years ago.
Category:
Database API (Doctrine DBAL)
Description
The sql_query function of DBAL does not respect the Mapping feature of DBAL.
Solution: parse the SQL String and Map Query to exec_* functions
Probably a depreciationlog entry should be written so that authors of extensions get informed they should use exec_*
(issue imported from #M12603)
Files
Even if this method is marked as deprecated since TYPO3 4.1 in DBAL, it overrides a method (from t3lib_db) that is not deprecated at all.
The phpDoc says that it only works for _DEFAULT handler and as such extension authors are properly warned.
However this method is quite handy too and heavily used by Extbase.
I propose to change the phpDoc to say that proper support of queries is experimental (as I cannot ensure it will work all the time), remove the @deprecated phpDoc comment and add support to try to automatically transfer query handling to exec_* methods, just as it should be done to ensure proper handling by DBAL.
If query cannot be parsed, it will simply fall-back to current behavior which is to execute the query with the _DEFAULT handler.
Please test the patch and report here if it works. In case it's OK, I'll commit it tonight to DBAL-trunk.
+1 by reading
will test later, that the "SELECT" part works we proved already yesterday evening.
For insert and update I'll have to create a test....
regards
Steffen
FYI, this patch won't be part of branch DBAL_1-0 (TYPO3 4.3.x). Once tested it will be commited to trunk to be hopefully part of TYPO3 4.4.
Committed to DBAL trunk as revision 28106
Also available in: Atom
PDF