[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] odbc manager: fix sql query syntax
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68c9257b1c4ca_2cde94097120@gitlab-sidekiq-low-urgency-cpu-bound-v2-7d77d7489b-jmv8b.mail> |
Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki
Commits:
01c02ece by Victor Emanouilov at 2025-09-16T11:53:06+03:00
[FIX] odbc manager: fix sql query syntax
- - - - -
1 changed file:
- lib/core/Tracker/Tabular/ODBCManager.php
Changes:
=====================================
lib/core/Tracker/Tabular/ODBCManager.php
=====================================
@@ -44,14 +44,16 @@ class ODBCManager
$result = odbc_fetch_array($rs);
} else {
$sql = "SELECT * FROM {$this->config['table']} WHERE " . implode(' AND ', array_map(function ($k, $v) {
- return empty($v) ? "\"{$k} IS NULL\"" : "\"{$k}\" = ?";
+ return empty($v) ? "\"{$k}\" IS NULL" : "\"{$k}\" = ?";
}, array_keys($row), $row));
$rs = odbc_prepare($conn, $sql);
$params = array_filter(array_values($row));
odbc_execute($rs, $params);
$result = odbc_fetch_array($rs);
}
- $result = $this->reverseMapFieldsFromConfig($result);
+ if ($result) {
+ $result = $this->reverseMapFieldsFromConfig($result);
+ }
$this->stopErrorHandler();
return $result;
}
@@ -240,7 +242,7 @@ class ODBCManager
$sql = "UPDATE {$this->config['table']} SET " . implode(', ', array_map(function ($k) {
return "\"{$k}\" = ?";
}, array_keys($chunk))) . " WHERE " . implode(' AND ', array_map(function ($k, $v) {
- return empty($v) ? "\"{$k} IS NULL\"" : "\"{$k}\" = ?";
+ return empty($v) ? "\"{$k}\" IS NULL" : "\"{$k}\" = ?";
}, array_keys($existing), $existing));
$rs = odbc_prepare($conn, $sql);
$params = array_map(function ($v) {
@@ -256,7 +258,7 @@ class ODBCManager
$existing[$k] = $v;
}
$sql = "SELECT * FROM {$this->config['table']} WHERE " . implode(' AND ', array_map(function ($k, $v) {
- return empty($v) ? "\"{$k} IS NULL\"" : "\"{$k}\" = ?";
+ return empty($v) ? "\"{$k}\" IS NULL" : "\"{$k}\" = ?";
}, array_keys($existing), $existing));
$rs = odbc_prepare($conn, $sql);
$params = array_filter(array_values($existing));
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/01c02ece9cbdcad5f6ace984d40a9688996c7508
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/01c02ece9cbdcad5f6ace984d40a9688996c7508
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