]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add patch for offset parameter support in SQL queries
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 9 Dec 2022 12:35:56 +0000 (13:35 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 9 Jan 2023 12:34:42 +0000 (13:34 +0100)
gui/baculum/debian/patches/fix-offset-parameter-in-php-framework.patch [new file with mode: 0644]

diff --git a/gui/baculum/debian/patches/fix-offset-parameter-in-php-framework.patch b/gui/baculum/debian/patches/fix-offset-parameter-in-php-framework.patch
new file mode 100644 (file)
index 0000000..62c5301
--- /dev/null
@@ -0,0 +1,30 @@
+From ed58d6bc276f5a3e1302d53f5fbc830b9816f8c1 Mon Sep 17 00:00:00 2001
+From: Marcin Haba <marcin.haba@bacula.pl>
+Date: Fri, 9 Dec 2022 13:30:34 +0100
+Subject: [PATCH] baculum: Fix OFFSET parameter in PHP framework
+
+Ticket in the PRADO framework GitHub project:
+
+Support for OFFSET parameter without LIMIT clause in SQL query for TActiveRecord
+
+https://github.com/pradosoft/prado/issues/819
+---
+ .../pradosoft/prado/framework/Data/DataGateway/TSqlCriteria.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gui/baculum/protected/vendor/pradosoft/prado/framework/Data/DataGateway/TSqlCriteria.php b/gui/baculum/protected/vendor/pradosoft/prado/framework/Data/DataGateway/TSqlCriteria.php
+index 4d0acc220d..07a20508a6 100644
+--- a/gui/baculum/protected/vendor/pradosoft/prado/framework/Data/DataGateway/TSqlCriteria.php
++++ b/gui/baculum/protected/vendor/pradosoft/prado/framework/Data/DataGateway/TSqlCriteria.php
+@@ -144,7 +144,7 @@ class TSqlCriteria extends \Prado\TComponent
+               //    [LIMIT {[offset,] row_count | row_count OFFSET offset}]
+               // See: http://dev.mysql.com/doc/refman/5.0/en/select.html
+-              if (preg_match('/ORDER\s+BY\s+(.*?)(?=LIMIT)|ORDER\s+BY\s+(.*?)$/i', $value, $matches) > 0) {
++              if (preg_match('/ORDER\s+BY\s+(.*?)(?=\s+(?:LIMIT|OFFSET))|ORDER\s+BY\s+(.*?)$/i', $value, $matches) > 0) {
+                       // condition contains ORDER BY
+                       $value = str_replace($matches[0], '', $value);
+                       if (strlen($matches[1]) > 0) {
+-- 
+2.35.3
+