From f44e474d39ec24f6b0cb0a5d656bb371ce7acd12 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sat, 22 Nov 2025 01:04:22 +0100 Subject: 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 --- adodb.inc.php | 5 +++-- 1 file 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; -- cgit v1.3