List:Commits« Previous MessageNext Message »
From:mcbrown Date:July 9 2008 7:33pm
Subject:svn commit - mysqldoc@docsrva: r11148 - trunk/tools/MySQL/DynXML
View as plain text  
Author: mcbrown
Date: 2008-07-09 19:33:41 +0200 (Wed, 09 Jul 2008)
New Revision: 11148

Log:
Adding support for a session-specific table
Fixing some column specifications




Modified:
   trunk/tools/MySQL/DynXML/Optvar.pm


Modified: trunk/tools/MySQL/DynXML/Optvar.pm
===================================================================
--- trunk/tools/MySQL/DynXML/Optvar.pm	2008-07-09 17:08:03 UTC (rev 11147)
+++ trunk/tools/MySQL/DynXML/Optvar.pm	2008-07-09 17:33:41 UTC (rev 11148)
Changed blocks: 10, Lines Added: 79, Lines Deleted: 16; 6179 bytes

@@ -178,6 +178,7 @@
         delete($options->{selectstatusvar});
         delete($options->{selectsystemvar});
         delete($options->{selectdynamicvar});
+        delete($options->{selectsessionvar});
         delete($options->{section});
         
         if (($options->{inserttype} eq 'optvar') && 

@@ -204,13 +205,23 @@
         if ($itemid eq 'systemvar')
         {
             $options->{selectsystemvar} = 'yes';
+            $options->{selectsessionvar} = 'no';
             $options->{selectstatusvar} = 'no';
             $options->{selectdynamicvar} = 'no';
             $options->{selectall} = 'no';
         }
+        elsif ($itemid eq 'sessionvar')
+        {
+            $options->{selectsystemvar} = 'no';
+            $options->{selectsessionvar} = 'yes';
+            $options->{selectstatusvar} = 'no';
+            $options->{selectdynamicvar} = 'no';
+            $options->{selectall} = 'no';
+        }
         elsif ($itemid eq 'statusvar')
         {
             $options->{selectsystemvar} = 'no';
+            $options->{selectsessionvar} = 'no';
             $options->{selectstatusvar} = 'yes';
             $options->{selectdynamicvar} = 'no';
             $options->{selectall} = 'no';

@@ -218,6 +229,7 @@
         elsif ($itemid eq 'dynamicvar')
         {
             $options->{selectsystemvar} = 'no';
+            $options->{selectsessionvar} = 'no';
             $options->{selectstatusvar} = 'no';
             $options->{selectdynamicvar} = 'yes';
             $options->{selectall} = 'no';

@@ -225,6 +237,7 @@
         elsif ($itemid =~ m/^section-(.*)$/)
         {
             $options->{selectsystemvar} = 'no';
+            $options->{selectsessionvar} = 'no';
             $options->{selectstatusvar} = 'no';
             $options->{selectdynamicvar} = 'no';
             $options->{selectall} = 'no';

@@ -367,6 +380,13 @@
         {
             next unless (exists($td->{$id}->{type}->{system}));
         }
+        elsif ((exists($options->{selectsessionvar}) && 
+             $options->{selectsessionvar} eq 'yes'))
+        {
+            next unless (exists($td->{$id}->{type}->{system}) &&
+                         defined($td->{$id}->{scope}) &&
+                         ($td->{$id}->{scope} eq 'session'));
+        }
         elsif ((exists($options->{selectstatusvar}) && 
              $options->{selectstatusvar} eq 'yes'))
         {

@@ -462,7 +482,7 @@
 
         foreach my $conf (sort { $a->{format} cmp $b->{format} } @cnffile)
         {
-            my $format = $conf->{format} || $id;;
+            my $format = $conf->{format} || $id;
             if (exists($td->{$id}->{xrefto}) &&
                
exists($idmap->{byprefixid}->{sprintf('refman-%s',$options->{version})}->{$td->{$id}->{xrefto}}))
             {

@@ -1288,6 +1308,14 @@
            $self->translate_phrase('var_scope',$options->{lang}),
            $self->translate_phrase('dynamic',$options->{lang}));
 
+    my $colcount = 7;
+
+    $colcount = 6 if ((exists($options->{selectsystemvar}) &&
+                       $options->{selectsystemvar} eq 'yes'));
+    
+    $colcount = 5 if ((exists($options->{selectsessionvar}) &&
+                       $options->{selectsessionvar} eq 'yes'));
+
     print $iodest <<EOF;
         <!--
         ****WARNING*****

@@ -1302,22 +1330,43 @@
         -->
 
 <informaltable>
-<tgroup cols="7">
+<tgroup cols="$colcount">
 <colspec colwidth="40*"/>
-<colspec colwidth="10*" align="center"/>
-<colspec colwidth="10*" align="center"/>
-<colspec colwidth="10*" align="center"/>
-<colspec colwidth="10*" align="center"/>
-<colspec colwidth="10*" align="center"/>
-<colspec colwidth="10*" align="center"/>
+EOF
+
+for(my $i=1;$i<$colcount;$i++)
+{
+    print $iodest '<colspec colwidth="10*" align="center"/>';
+}
+
+print $iodest <<EOF;
 <thead>
 <row>
 <entry><emphasis role="bold">$title_name</emphasis></entry>
 <entry><emphasis role="bold">$title_cmd_line</emphasis></entry>
 <entry><emphasis
role="bold">$title_option_file</emphasis></entry>
 <entry><emphasis role="bold">$title_system_var</emphasis></entry>
+EOF
+
+if ((exists($options->{selectsystemvar}) &&
+     $options->{selectsystemvar} eq 'no') &&
+    (exists($options->{selectsessionvar}) &&
+     $options->{selectsessionvar} eq 'no'))
+{
+    print $iodest <<EOF;
 <entry><emphasis role="bold">$title_status_var</emphasis></entry>
+EOF
+}
+
+if ((exists($options->{selectsessionvar}) &&
+     $options->{selectsessionvar} eq 'no'))
+{
+    print $iodest <<EOF;
 <entry><emphasis role="bold">$title_var_scope</emphasis></entry>
+EOF
+}
+
+print $iodest <<EOF;
 <entry><emphasis role="bold">$title_dynamic</emphasis></entry>
 </row>
 </thead>

@@ -1333,9 +1382,19 @@
         my $opts = {};
 
         push @{$row},$id;
-        
-        foreach my $type (qw/cmdline mycnf system status/)
+
+        my @corefields = qw/cmdline mycnf system status/;
+
+        if ((exists($options->{selectsystemvar}) &&
+             $options->{selectsystemvar} eq 'yes') ||
+            (exists($options->{selectsessionvar}) &&
+             $options->{selectsessionvar} eq 'yes'))
         {
+            @corefields = qw/cmdline mycnf system/;
+        }
+            
+        foreach my $type (@corefields)
+        {
             if (exists($td->{$id}->{type}->{$type}))
             {
                 push @{$row},$self->translate_phrase('yes',$options->{lang});

@@ -1346,14 +1405,18 @@
             }
         }
         
-        if (exists($td->{$id}->{scope}))
+        if (exists($options->{selectsessionvar}) &&
+            $options->{selectsessionvar} eq 'no')
         {
-            push
@{$row},$self->translate_phrase($td->{$id}->{scope},$options->{lang});
+            if (exists($td->{$id}->{scope}))
+            {
+                push
@{$row},$self->translate_phrase($td->{$id}->{scope},$options->{lang});
+            }
+            else
+            {
+                push @{$row},'';
+            }
         }
-        else
-        {
-            push @{$row},'';
-        }
 
         if (exists($td->{$id}->{isdynamic}))
         {


Thread
svn commit - mysqldoc@docsrva: r11148 - trunk/tools/MySQL/DynXMLmcbrown9 Jul