]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/blob - separate-rpmdb.patch
update patches
[packages/dokuwiki-plugin-data.git] / separate-rpmdb.patch
1 Separate rpmdb data to rpmdb table, left join via %rpm% field name on demand.
2
3 As the rpmdb data is huge comparing to other data, it's best we keep it
4 in separate table, if it is still a performance problem, we could use
5 separate datafile.
6
7 You need to create 'rpm' table manually:
8 CREATE TABLE rpmdb (eid INTEGER PRIMARY KEY, pid INTEGER, value);
9
10 Handling it automatically would mean have to renumber upstream patches each
11 time...
12
13 --- dokuwiki-plugin-data-20160311/helper.php~   2016-11-22 23:06:06.000000000 +0200
14 +++ dokuwiki-plugin-data-20160311/helper.php    2016-11-22 23:06:44.267324645 +0200
15 @@ -385,6 +385,7 @@
16              '%title%'   => array('page', 'title'),
17              '%pageid%'  => array('title', 'page'),
18              '%class%'   => array('class'),
19 +            '%rpm%'     => array('rpm'),
20              '%lastmod%' => array('lastmod', 'timestamp')
21          );
22          if(isset($specials[$column['title']])) {
23 --- dokuwiki-plugin-data-20120227/lang/en/lang.php~     2012-02-27 16:32:51.000000000 +0200
24 +++ dokuwiki-plugin-data-20120227/lang/en/lang.php      2012-03-13 13:12:04.190745746 +0200
25 @@ -16,6 +16,7 @@
26  $lang['page']      = 'Page';
27  $lang['title']     = 'Page Name';
28  $lang['class']     = 'Page Class';
29 +$lang['rpm']       = 'RPM Package';
30  $lang['lastmod']   = 'Last Modified';
31  
32  $lang['name']      = 'Type Alias';
33 --- dokuwiki-plugin-data-20160311/syntax/table.php~     2016-07-01 14:27:21.000000000 +0300
34 +++ dokuwiki-plugin-data-20160311/syntax/table.php      2016-11-22 23:08:01.967907897 +0200
35 @@ -584,6 +584,13 @@
36                  $select[] = 'pages.lastmod';
37              } elseif($key == '%title%') {
38                  $select[] = "pages.page || '|' || pages.title";
39 +            } elseif($key == '%rpm%'){
40 +                if(!isset($tables[$key])){
41 +                    $tables[$key] = 'T'.(++$cnt);
42 +                    $from  .= ' LEFT JOIN rpmdb AS '.$tables[$key].' ON '.$tables[$key].'.pid = pages.pid';
43 +                }
44 +                $select[] = "group_concat(".$tables[$key].".value,'\n')";
45 +
46              } else {
47                  if(!isset($tables[$key])) {
48                      $tables[$key] = 'T' . (++$cnt);
This page took 0.151227 seconds and 4 git commands to generate.