[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] ODBC: check for existing results in a more safe way that works with...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <693ffd05afbde_2a17f7501720@gitlab-sidekiq-low-urgency-cpu-bound-v2-55c9b978c9-8brn8.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
2c9e07a8 by Victor Emanouilov at 2025-12-15T14:20:15+02:00
[FIX] ODBC: check for existing results in a more safe way that works with broader range of odbc drivers and backends

- - - - -


1 changed file:

- lib/core/Tracker/Tabular/ODBCManager.php


Changes:

=====================================
lib/core/Tracker/Tabular/ODBCManager.php
=====================================
@@ -120,7 +120,7 @@ class ODBCManager
             $sql = "SELECT \"{$pk}\" FROM {$this->config['table']} WHERE \"{$pk}\" = ?";
             $rs = odbc_prepare($conn, $sql);
             odbc_execute($rs, [$id]);
-            $exists = odbc_num_rows($rs) > 0;
+            $exists = odbc_fetch_array($rs) ? true : false;
         } else {
             $exists = false;
             $id = null;
@@ -291,7 +291,7 @@ class ODBCManager
         $rs = odbc_prepare($conn, $sql);
         if ($rs) {
             odbc_execute($rs, [$value]);
-            $exists = odbc_num_rows($rs) > 0;
+            $exists = odbc_fetch_array($rs) ? true : false;
         } else {
             $exists = false;
         }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2c9e07a821fc869ce3eefdc7eb8ca4b498a8f9d8

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2c9e07a821fc869ce3eefdc7eb8ca4b498a8f9d8
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.