Feature #21560
closedsql_query does not respect "mapping"
0%
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
Updated by Xavier Perseguers about 15 years ago
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.
Updated by Steffen Ritter about 15 years ago
+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
Updated by Xavier Perseguers about 15 years ago
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.
Updated by Xavier Perseguers almost 15 years ago
Committed to DBAL trunk as revision 28106