Bug #59982 Optvar value-lists shouldn't be comma-delimited in output
Submitted: 7 Feb 2011 11:02 Modified: 7 Feb 2011 16:08
Reporter: Jon Stephens Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: Documentation Toolset Severity:S3 (Non-critical)
Version:ALL OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[7 Feb 2011 11:02] Jon Stephens
Description:
When a <mysqloption/> (that uses mysqldoc-toolset/mysql-dtd.d/command-optvars.dtd) has a list (i.e. a set of <choice value="..."/> elements) rather than a range of permitted values, the list is formatted as a comma-separated list in the output.

However, there is at least one case of a variable having a value that includes a comma: the server variable slave_type_conversions accepts the string "ALL_LOSSY,ALL_NON_LOSSY". Thus, at

http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#sysvar_slave_type_co...

we have

Valid Values 	ALL_LOSSY, ALL_NON_LOSSY, ALL_LOSSY,ALL_NON_LOSSY

which is quite confusing.

How to repeat:
See Description.

Suggested fix:
Rather than using commas, wrap each value from the list in a <para>...</para> when generating the DocBookXML. This should cause each value in the list to appear on a separate line after processing, e.g.

Valid Values 	ALL_LOSSY
                ALL_NON_LOSSY
                ALL_LOSSY,ALL_NON_LOSSY
[7 Feb 2011 16:08] Jon Stephens
Author: jstephens
Date: 2011-02-07 16:49:37 +0100 (Mon, 07 Feb 2011)
New Revision: 653

Log:

Quick hack to fix BUG#59982

Modified:
   tools/MySQL/DynXML/Optvar.pm

Modified: tools/MySQL/DynXML/Optvar.pm
===================================================================
--- tools/MySQL/DynXML/Optvar.pm	2011-02-03 14:02:48 UTC (rev 652)
+++ tools/MySQL/DynXML/Optvar.pm	2011-02-07 15:49:37 UTC (rev 653)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 1; 647 bytes

@@ -1429,7 +1429,7 @@
                                        )
                              ),
                              xml_entry({namest => 'vd',nameend => 'v'},
-                                       join(', ',map { xml_literal($_) } @{$valuetype->{choices}}))));
+                                       join('<para/>',map { xml_literal($_) } @{$valuetype->{choices}}))));
                 }
             }
[7 Feb 2011 16:57] Jon Stephens
Much better fix:

Author: jstephens
Date: 2011-02-07 17:48:22 +0100 (Mon, 07 Feb 2011)
New Revision: 656

Log:

A much better fix for BUG#59982

Modified:
   tools/MySQL/DynXML/Optvar.pm
   xsl.d/mysql-fo.xsl
   xsl.d/mysql-html.xsl

Modified: tools/MySQL/DynXML/Optvar.pm
===================================================================
--- tools/MySQL/DynXML/Optvar.pm	2011-02-07 15:54:24 UTC (rev 655)
+++ tools/MySQL/DynXML/Optvar.pm	2011-02-07 16:48:22 UTC (rev 656)
Changed blocks: 2, Lines Added: 4, Lines Deleted: 2; 1144 bytes

@@ -1429,7 +1429,9 @@
                                        )
                              ),
                              xml_entry({namest => 'vd',nameend => 'v'},
-                                       join('<para/>',map { xml_literal($_) } @{$valuetype->{choices}}))));
+                                       join('<?linebreak?>', map {
+                                       xml_literal($_) }
+                                       @{$valuetype->{choices}}) )));
                 }
             }
 

@@ -2122,7 +2124,7 @@
                 )
             {
                 $attr->{_xref} = $options->{xref};
-                $self->alert_fatal("Have a undefined ID, which should be impossible " . Dumper($row)) unless (defined($options->{xref}));
+                $self->alert_fatal("Have an undefined ID, which should be impossible " . Dumper($row)) unless (defined($options->{xref}));
             }
         }
 

Modified: xsl.d/mysql-fo.xsl
===================================================================
--- xsl.d/mysql-fo.xsl	2011-02-07 15:54:24 UTC (rev 655)
+++ xsl.d/mysql-fo.xsl	2011-02-07 16:48:22 UTC (rev 656)
Changed blocks: 1, Lines Added: 3, Lines Deleted: 1; 438 bytes

@@ -136,5 +136,7 @@
   <xsl:template match="command">
     <xsl:call-template name="inline.monoseq"/>
   </xsl:template>
-
+  <xsl:template match="processing-instruction('linebreak')">
+    <fo:block/>
+  </xsl:template>
 </xsl:stylesheet>

Modified: xsl.d/mysql-html.xsl
===================================================================
--- xsl.d/mysql-html.xsl	2011-02-07 15:54:24 UTC (rev 655)
+++ xsl.d/mysql-html.xsl	2011-02-07 16:48:22 UTC (rev 656)
Changed blocks: 1, Lines Added: 3, Lines Deleted: 1; 478 bytes

@@ -24,6 +24,8 @@
 <xsl:param name="index.on.type" select="1"/>
 
 <!-- strip remark elements -->
-<xsl:template match="remark" />
+  <xsl:template match="remark" /><xsl:template match="processing-instruction('linebreak')">
+    <br/>
+  </xsl:template>
 
 </xsl:stylesheet>