[drupal-devel] [bug] _db_query() does not return FALSE in case of errors, as stated in documentation

Cvbge drupal-devel at drupal.org
Fri Jun 24 06:53:50 UTC 2005


Issue status update for http://drupal.org/node/25522

 Project:      Drupal
 Version:      cvs
 Component:    database system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Cvbge
 Updated by:   Cvbge
 Status:       patch

I have moved the db_error part to http://drupal.org/node/25673




Cvbge



Previous comments:
------------------------------------------------------------------------

June 22, 2005 - 14:40 : Cvbge

Attachment: http://drupal.org/files/issues/database.mysql.inc.diff (318 bytes)

According to documentation db_query() should return FALSE "if the query
was not executed correctly". This function calls _db_query() which
returns nothing in such cases (for example when the sql syntax is
wrong).


Attached one-liner fixes this by adding return FALSE to _db_query().
It's from 4.6.1 but should apply to cvs without problems. Please apply
this patch also to 4.6 branch.


But there seems to be a problem with db_error(). It calls mysql_errno()
but it seems that errors are cleared after mysql_error() call. So
db_error() does not indicate any errors even if they occur.







More information about the drupal-devel mailing list