[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [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 <693ffd1a513fe_2a17f82c76196@gitlab-sidekiq-low-urgency-cpu-bound-v2-55c9b978c9-fvzq9.mail>

Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
f2e52057 by Victor Emanouilov at 2025-12-15T14:20:37+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/f2e52057bc5d62c3634a6b78babf9c08c96439a2

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f2e52057bc5d62c3634a6b78babf9c08c96439a2
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.