?
avatar fpaixao
fpaixao
31 Mar 2016

Steps to reproduce the issue

install a new joomla extension with an error. A wrong foreing key, as an exemplo.

Expected result

Jommla will notify: Mysql error #... table....

Actual result

Jommla will notify: Mysql error BUT DOES NOT INFORM THE TABLE!!!

System information (as much as possible)

Additional comments

avatar fpaixao fpaixao - open - 31 Mar 2016
avatar brianteeman brianteeman - change - 31 Mar 2016
Category SQL
avatar brianteeman
brianteeman - comment - 31 Mar 2016

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.

avatar brianteeman brianteeman - change - 1 Apr 2016
Status New Information Required
avatar andrepereiradasilva
andrepereiradasilva - comment - 2 Apr 2016

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,

avatar fpaixao
fpaixao - comment - 4 Apr 2016

This happens only if using PDOMysql driver. The imySQL driver works perfectly.

avatar mbabker
mbabker - comment - 4 Apr 2016

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?).

avatar brianteeman brianteeman - change - 5 Apr 2016
Status Information Required New
avatar mbabker mbabker - change - 8 Jan 2017
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-01-08 18:44:21
Closed_By mbabker
avatar mbabker mbabker - close - 8 Jan 2017
avatar mbabker
mbabker - comment - 8 Jan 2017

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.

Add a Comment

Login with GitHub to post a comment