]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/commitdiff
Re-order LEFT JOIN pages before LEFT JOIN rpm master auto/th/dokuwiki-plugin-data-20220727-2
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 25 Apr 2023 12:28:50 +0000 (15:28 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Tue, 25 Apr 2023 12:28:50 +0000 (15:28 +0300)
dokuwiki-plugin-data.spec
separate-rpmdb.patch

index d40b335fbffbba9d5ada35df6b8c3aac671dba5c..7c29b4c227dea92ca78a071cec051dc4acd6a7e4 100644 (file)
@@ -5,7 +5,7 @@
 Summary:       DokuWiki Structured Data Plugin
 Name:          dokuwiki-plugin-%{plugin}
 Version:       %{ver}
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       https://github.com/splitbrain/dokuwiki-plugin-%{plugin}/archive/%{subver}/%{plugin}-%{subver}.tar.gz
index d16d484b0400c20a5798447af052734557f214e7..7a4e71e01f53dfe1edad4f46ccd40b0c9948ab34 100644 (file)
@@ -30,8 +30,8 @@ time...
  $lang['lastmod']   = 'Last Modified';
  
  $lang['name']      = 'Type Alias';
---- dokuwiki-plugin-data-20160311/syntax/table.php~    2016-07-01 14:27:21.000000000 +0300
-+++ dokuwiki-plugin-data-20160311/syntax/table.php     2016-11-22 23:08:01.967907897 +0200
+--- dokuwiki-plugin-data-20160311/syntax/table.php     2016-11-22 23:08:01.967907897 +0200
++++ dokuwiki-plugin-data-20220727/syntax/table.php     2023-04-25 15:27:50.645943694 +0300
 @@ -584,6 +584,13 @@
                  $select[] = 'pages.lastmod';
              } elseif($key == '%title%') {
@@ -46,3 +46,25 @@ time...
              } else {
                  if(!isset($tables[$key])) {
                      $tables[$key] = 'T' . (++$cnt);
+@@ -686,6 +693,21 @@
+                 GROUP BY W1.pid
+                 $order";
++        // Re-order LEFT JOIN pages before LEFT JOIN rpm
++        $sql = preg_replace_callback('/
++            (?P<before>.+)
++            (?P<rpmdb>LEFT\sJOIN\srpmdb\sAS\sT\d+\sON\sT\d+.pid\s=\spages.pid\s+)
++            (?P<pages>LEFT\sJOIN\spages\sON\sW\d+\.pid\s*=pages\.pid\s+)
++            (?P<after>.+)
++        /xm', function ($m) {
++            return implode("", [
++                $m['before'],
++                $m['pages'],
++                $m['rpmdb'],
++                $m['after'],
++            ]);
++        }, $sql);
++
+         // offset and limit
+         if($data['limit']) {
+             $sql .= ' LIMIT ' . ($data['limit'] + 1);
This page took 0.240287 seconds and 4 git commands to generate.