[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 07:00:11 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 forgot to make a patch for database.pgsql, but the change is the same.




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.




------------------------------------------------------------------------

June 24, 2005 - 08:53 : Cvbge

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







More information about the drupal-devel mailing list