[TikiWiki-commits] [Git][tikiwiki/tiki][26.x] [FIX] ODBC: fix sql server max value get query
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68a2f09e8a194_2c6b564883338@gitlab-sidekiq-low-urgency-cpu-bound-v2-5d7cc58987-mj48k.mail> |
Victor Emanouilov pushed to branch 26.x at Tiki Wiki CMS Groupware / Tiki
Commits:
bd1e5093 by Victor Emanouilov at 2025-08-18T12:21:30+03:00
[FIX] ODBC: fix sql server max value get query
- - - - -
1 changed file:
- lib/core/Tracker/Tabular/ODBCManager.php
Changes:
=====================================
lib/core/Tracker/Tabular/ODBCManager.php
=====================================
@@ -301,7 +301,11 @@ class ODBCManager
{
$this->handleErrors();
$conn = $this->getConnection();
- $sql = "SELECT MAX(CAST(\"$field\" AS DECIMAL(20,0))) as last from {$this->config['table']} WHERE \"$field\" REGEXP '^[0-9]+$'";
+ if (stristr($this->config['dsn'], 'mysql') || stristr($this->config['dsn'], 'mariadb')) {
+ $sql = "SELECT MAX(CAST(\"$field\" AS SIGNED)) as last from {$this->config['table']} WHERE \"$field\" REGEXP '^[0-9]+$'";
+ } else {
+ $sql = "SELECT MAX(CAST(\"$field\" AS INT)) as last from {$this->config['table']} WHERE ISNUMERIC(\"$field\") = 1";
+ }
$rs = odbc_prepare($conn, $sql);
if ($rs) {
odbc_execute($rs, []);
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/bd1e5093d19728fdf8d8ee0c31b4f80a78136331
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/bd1e5093d19728fdf8d8ee0c31b4f80a78136331
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