]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/blob - separate-rpmdb.patch
- up to 20120227; adds %lastmod% filter
[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-20120227/db/latest.version~   2012-02-27 16:32:51.000000000 +0200
14 #+++ dokuwiki-plugin-data-20120227/db/latest.version    2012-03-13 13:10:57.241251292 +0200
15 #@@ -1 +1 @@
16 #-5
17 #+6
18 --- dokuwiki-plugin-data-20120227/helper.php~   2012-03-13 13:10:04.000000000 +0200
19 +++ dokuwiki-plugin-data-20120227/helper.php    2012-03-13 13:11:33.742793083 +0200
20 @@ -184,6 +184,7 @@
21          static $specials = array('%title%'   => array('page', 'title'),
22                                   '%pageid%'  => array('title', 'page'),
23                                   '%class%'   => array('class'),
24 +                                 '%rpm%'     => array('rpm'),
25                                   '%lastmod%' => array('lastmod','timestamp'));
26          if (isset($specials[$column['title']])) {
27              $s = $specials[$column['title']];
28 --- dokuwiki-plugin-data-20120227/lang/en/lang.php~     2012-02-27 16:32:51.000000000 +0200
29 +++ dokuwiki-plugin-data-20120227/lang/en/lang.php      2012-03-13 13:12:04.190745746 +0200
30 @@ -16,6 +16,7 @@
31  $lang['page']      = 'Page';
32  $lang['title']     = 'Page Name';
33  $lang['class']     = 'Page Class';
34 +$lang['rpm']       = 'RPM Package';
35  $lang['lastmod']   = 'Last Modified';
36  
37  $lang['name']      = 'Type Alias';
38 --- dokuwiki-plugin-data-20100608/syntax/table.php      2010-11-03 15:20:30.000000000 +0200
39 +++ dokuwiki-plugin-data-20100608/syntax/table.php      2010-12-01 19:50:59.217678000 +0200
40 @@ -328,6 +328,13 @@
41                  $select[] = '" " || pages.class';
42              }elseif($key == '%title%'){
43                  $select[] = "pages.page || '|' || pages.title";
44 +            }elseif($key == '%rpm%'){
45 +                if(!isset($tables[$key])){
46 +                    $tables[$key] = 'T'.(++$cnt);
47 +                    $from  .= ' LEFT JOIN rpmdb AS '.$tables[$key].' ON '.$tables[$key].'.pid = pages.pid';
48 +                }
49 +                $select[] = "group_concat(".$tables[$key].".value,'\n')";
50 +
51              }else{
52                  if(!isset($tables[$key])){
53                      $tables[$key] = 'T'.(++$cnt);
This page took 0.037437 seconds and 4 git commands to generate.