[TikiWiki-commits] [Git][tikiwiki/tiki][26.x] [FIX] ODBC get last auto-increment - make it database type indepdendent

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68a2d31824796_2cd6ccc42351@gitlab-sidekiq-low-urgency-cpu-bound-v2-5d7cc58987-ffsxt.mail>

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


Commits:
9a030bc3 by Victor Emanouilov at 2025-08-18T10:15:31+03:00
[FIX] ODBC get last auto-increment - make it database type indepdendent

- - - - -


1 changed file:

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


Changes:

=====================================
lib/core/Tracker/Tabular/ODBCManager.php
=====================================
@@ -301,7 +301,7 @@ class ODBCManager
     {
         $this->handleErrors();
         $conn = $this->getConnection();
-        $sql = "SELECT MAX(CAST(\"$field\" AS INT)) as last from {$this->config['table']} WHERE ISNUMERIC(\"$field\") = 1";
+        $sql = "SELECT MAX(CAST(\"$field\" AS DECIMAL(20,0))) as last from {$this->config['table']} WHERE \"$field\" REGEXP '^[0-9]+$'";
         $rs = odbc_prepare($conn, $sql);
         if ($rs) {
             odbc_execute($rs, []);



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9a030bc3bd3bdf87a5eac01e0f1eb4de0619213a

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