[drupal-devel] [bug] _db_query() does not return FALSE in case of errors, as stated in documentation
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 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. Cvbge
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.
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
Issue status update for http://drupal.org/node/25522 Post a follow up: http://drupal.org/project/comments/add/25522 Project: Drupal Version: cvs Component: database system Category: bug reports Priority: normal Assigned to: Anonymous Reported by: Cvbge Updated by: Cvbge Status: patch (code needs review) Attachment: http://drupal.org/files/issues/_db_query.diff (1.01 KB) Patch against current cvs, have both mysql and postgresql db. Maybe now someone will take a look at it? Cvbge Previous comments: ------------------------------------------------------------------------ Wed, 22 Jun 2005 12:40:50 +0000 : 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. ------------------------------------------------------------------------ Fri, 24 Jun 2005 06:53:43 +0000 : Cvbge I have moved the db_error part to http://drupal.org/node/25673 ------------------------------------------------------------------------ Fri, 24 Jun 2005 07:00:03 +0000 : Cvbge I forgot to make a patch for database.pgsql, but the change is the same.
Issue status update for http://drupal.org/node/25522 Post a follow up: http://drupal.org/project/comments/add/25522 Project: Drupal Version: cvs Component: database system Category: bug reports Priority: normal Assigned to: Anonymous Reported by: Cvbge Updated by: killes@www.drop.org -Status: patch (code needs review) +Status: patch (ready to be committed) Attachment: http://drupal.org/files/issues/_db_query_0.diff (1.05 KB) The patch makes sense to me. It shoudl have been rolled from the Drupal base directory, which I did. killes@www.drop.org Previous comments: ------------------------------------------------------------------------ Wed, 22 Jun 2005 12:40:50 +0000 : 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. ------------------------------------------------------------------------ Fri, 24 Jun 2005 06:53:43 +0000 : Cvbge I have moved the db_error part to http://drupal.org/node/25673 ------------------------------------------------------------------------ Fri, 24 Jun 2005 07:00:03 +0000 : Cvbge I forgot to make a patch for database.pgsql, but the change is the same. ------------------------------------------------------------------------ Sun, 07 Aug 2005 09:53:15 +0000 : Cvbge Attachment: http://drupal.org/files/issues/_db_query.diff (1.01 KB) Patch against current cvs, have both mysql and postgresql db. Maybe now someone will take a look at it?
Issue status update for http://drupal.org/node/25522 Post a follow up: http://drupal.org/project/comments/add/25522 Project: Drupal -Version: cvs +Version: 4.6.2 Component: database system Category: bug reports Priority: normal Assigned to: Anonymous Reported by: Cvbge Updated by: Cvbge -Status: fixed +Status: patch (ready to be committed) Please also apply to 4.6, patch applies without problems. Cvbge Previous comments: ------------------------------------------------------------------------ Wed, 22 Jun 2005 12:40:50 +0000 : 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. ------------------------------------------------------------------------ Fri, 24 Jun 2005 06:53:43 +0000 : Cvbge I have moved the db_error part to http://drupal.org/node/25673 ------------------------------------------------------------------------ Fri, 24 Jun 2005 07:00:03 +0000 : Cvbge I forgot to make a patch for database.pgsql, but the change is the same. ------------------------------------------------------------------------ Sun, 07 Aug 2005 09:53:15 +0000 : Cvbge Attachment: http://drupal.org/files/issues/_db_query.diff (1.01 KB) Patch against current cvs, have both mysql and postgresql db. Maybe now someone will take a look at it? ------------------------------------------------------------------------ Sun, 07 Aug 2005 17:07:25 +0000 : killes@www.drop.org Attachment: http://drupal.org/files/issues/_db_query_0.diff (1.05 KB) The patch makes sense to me. It shoudl have been rolled from the Drupal base directory, which I did. ------------------------------------------------------------------------ Thu, 11 Aug 2005 13:51:23 +0000 : Dries Committed to HEAD. Thanks.
participants (2)
-
Cvbge -
killes