diff options
| author | Damien Regad <dregad@mantisbt.org> | 2025-11-22 01:04:22 +0100 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2025-11-22 01:04:22 +0100 |
| commit | f44e474d39ec24f6b0cb0a5d656bb371ce7acd12 (patch) | |
| tree | b3fe4c0b68c50cff9a8531aa5cbda6bc46d91b42 | |
| parent | fff974544c78b4917778fa5ec2cf9b50ca2ca72c (diff) | |
| download | adodb-f44e474d39ec24f6b0cb0a5d656bb371ce7acd12.tar.gz adodb-f44e474d39ec24f6b0cb0a5d656bb371ce7acd12.tar.bz2 adodb-f44e474d39ec24f6b0cb0a5d656bb371ce7acd12.zip | |
autoExecute return false on update with no match
If the specified where clause returns no rows, then we return false
early, there is no point building and executing an UPDATE statement
that will do nothing.
Fixes #1148
| -rw-r--r-- | adodb.inc.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/adodb.inc.php b/adodb.inc.php index 64138e89..07fdf72d 100644 --- a/adodb.inc.php +++ b/adodb.inc.php @@ -2685,8 +2685,9 @@ if (!defined('_ADODB_LAYER')) { } $rs = $this->SelectLimit($sql, 1); - if (!$rs) { - return false; // table does not exist + if (!$rs || $mode == DB_AUTOQUERY_UPDATE && $rs->EOF) { + // Table does not exist or udpate where clause matches no rows + return false; } $rs->tableName = $table; |
