summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2026-03-02 18:41:33 +0100
committerDamien Regad <dregad@mantisbt.org>2026-03-02 18:41:33 +0100
commitdedd763d9de3f5aed2b192479bb96d7fc9833175 (patch)
treec80af12ae2758b1e3512add4763b855e96b14cf2
parent52a8fbebeb1e24b363e38019a786c1e5ee8cff37 (diff)
downloadadodb-dedd763d9de3f5aed2b192479bb96d7fc9833175.tar.gz
adodb-dedd763d9de3f5aed2b192479bb96d7fc9833175.tar.bz2
adodb-dedd763d9de3f5aed2b192479bb96d7fc9833175.zip
Fix metaColummns() throwing exception
Calling metaColumns() on a non-existing table triggers an unexpected Exception when using adodb-exceptions.inc.php. The method should just return false in this case. The problem was due to an incorrect evaluation of the table existence check's return value, resulting in unwanted execution of a SHOW COLUMNS statement which returned MySQL error 1146 (42S02): Table doesn't exist. Regression introduced by 5f589f64cea42c792929832cffe26825831f8c94 (see Issue #1016). Fixes #1212
-rw-r--r--drivers/adodb-mysqli.inc.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php
index a79467a3..9c681f17 100644
--- a/drivers/adodb-mysqli.inc.php
+++ b/drivers/adodb-mysqli.inc.php
@@ -1014,9 +1014,11 @@ class ADODB_mysqli extends ADOConnection {
AND table_name='$table'";
$schemaArray = $this->getAssoc($SQL);
- if (is_array($schemaArray)) {
+ if ($schemaArray) {
$schemaArray = array_change_key_case($schemaArray,CASE_LOWER);
$rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
+ } else {
+ $rs = false;
}
if (isset($savem)) $this->SetFetchMode($savem);