install a new joomla extension with an error. A wrong foreing key, as an exemplo.
Jommla will notify: Mysql error #... table....
Jommla will notify: Mysql error BUT DOES NOT INFORM THE TABLE!!!
Category | ⇒ | SQL |
Status | New | ⇒ | Information Required |
the code for Joomla PDO database driver is here https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/pdo.php and here for pdomysql specific https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/pdomysql.php
Maybe you can make a Pull Request for solving the issue,
This happens only if using PDOMysql driver. The imySQL driver works perfectly.
I looked earlier. Joomla manually appends the executed SQL query to the error message that the underlying database connector uses for all the non-PDO based drivers. This doesn't happen with the PDO driver. This is also why SQL errors always display the full query on error screens.
If JLog were more PSR-3 structured I'd say that the query should be part of the context array and not displayed on screen in a message (but logged to the error log appropriately), but we don't have that option unfortunately as you can only give it a string to process (what's to be gained by showing the full query in an error message to the general public anyway?).
Status | Information Required | ⇒ | New |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-08 18:44:21 |
Closed_By | ⇒ | mbabker |
Closing this. Having the SQL query as part of the Exception message has been removed in 3.7, if you need the query in your error handling catch JDatabaseExceptionExecuting
and call its getQuery
method.
Is this just with the PDO driver or with mysqli as well?
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9682.