The includes/database.(mysql)|(mysqli)|(pgsql) files all report sql errors in a similar fashion e.g.

if (!mysql_errno($active_db)) {
return $result;
}
else {
trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
return FALSE;
}

But the error_handler function uses the t() function on the message

So sql errors are always double escaped, this makes them much harder to read and prevents copy-pasting the query - for running directly.

I think that check_plain should not be called in this place - removing this function call works OK for me.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Version: 5.x-dev » 6.x-dev
Priority: Minor » Normal

Bumping to D6, because this issue does not exist in the new database layer of D7.

Damien Tournoud’s picture

Status: Active » Needs review
FileSize
1.97 KB
2.15 KB

Two small patches (for D6 and D5).

dpearcefl’s picture

Is this still an issue using current Drupal 6?

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.