Author: mysqlpp
Date: Sun Feb 7 16:01:35 2010
New Revision: 2623
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2623&view=rev
Log:
Wrote up the new --with-field-limit configure script flag and -f
lib/*.pl script flags in userman and README-Unix.txt.
Modified:
trunk/README-Unix.txt
trunk/doc/userman/common.xsl
trunk/doc/userman/configuration.dbx
Modified: trunk/README-Unix.txt
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/README-Unix.txt?rev=2623&r1=2622&r2=2623&view=diff
==============================================================================
--- trunk/README-Unix.txt (original)
+++ trunk/README-Unix.txt Sun Feb 7 16:01:35 2010
@@ -55,6 +55,14 @@
which subdirectory under the given directory contains the
needed files, so you don't necessarily have to give the full
path to these files.
+
+ --with-field-limit:
+
+ This lets you increase the maximum field limit for template
+ queries and SSQLSes. By default, both are limited to 25
+ fields. See chapter 8.2 in the user manual for details:
+
+ http://tangentsoft.net/mysql++/doc/html/userman/configuration.html
--enable-thread-check:
Modified: trunk/doc/userman/common.xsl
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/doc/userman/common.xsl?rev=2623&r1=2622&r2=2623&view=diff
==============================================================================
--- trunk/doc/userman/common.xsl (original)
+++ trunk/doc/userman/common.xsl Sun Feb 7 16:01:35 2010
@@ -7,5 +7,10 @@
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.autolabel.max.depth" select="2"/>
<xsl:param name="toc.section.depth" select="2"/>
+
+ <!-- allow faking <mathphrase> in DocBook 4.4 and earlier -->
+ <xsl:template match="phra...@role = 'math']">
+ <xsl:call-template name="inline.italicseq"/>
+ </xsl:template>
</xsl:stylesheet>
Modified: trunk/doc/userman/configuration.dbx
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/doc/userman/configuration.dbx?rev=2623&r1=2622&r2=2623&view=diff
==============================================================================
--- trunk/doc/userman/configuration.dbx (original)
+++ trunk/doc/userman/configuration.dbx Sun Feb 7 16:01:35 2010
@@ -47,43 +47,86 @@
</sect2>
- <sect2 id="max-columns">
- <title>The Maximum Number of Columns Allowed</title>
+ <sect2 id="max-fields">
+ <title>The Maximum Number of Fields Allowed</title>
- <para>MySQL++ offers two ways to automatically build SQL queries at
- run time: <xref linkend="tquery"/> and <link
+ <para>MySQL++ offers two ways to automatically build SQL
+ queries at run time: <xref linkend="tquery"/> and <link
linkend="ssqls">SSQLS</link>. There’s a limit on the number
- of template query parameters and the number of SSQLS fields, due to
- the way these mechanisms work. Both are set to 25, by default. We
- arrived at these limits empirically, partly by looking at good
- database designs, and by testing compilers to find their limits. We
- wanted a limit that doesn’t often need to be raised without
- unduly narrowing the list of supported platforms by exceeding
- compiler limits.</para>
+ of fields these mechanisms support, primarily to avoid exceeding
+ limits in some compilers. The default for each is 25 fields in the
+ source distribution.<footnote><para>If you’re using a binary
+ MySQL++ package, its maintainer may have increased these field
+ counts so the resulting headers more closely approach the size
+ limit of the compiler the package was built with. In that case,
+ you can look at the top of each generated header file to find
+ out how many fields each supports.</para></footnote> This is high
+ enough to work with most good database designs.<footnote><para>If
+ your database design has a table with more than 25 columns,
+ you might consider refactoring it. It’s a fair indicator
+ the design commits some sin a DBA would castigate as improper
+ normalization.</para></footnote></para>
- <para>If it happens that your database design does need more than
- 25 columns or template query parameters, first look to see if
- there’s a good way to change the design. It’s usually
- a sign of too many unrelated things in one table if you need so
- many columns. If you decide the design is good, you can raise these
- limits by re-generating the <filename>lib/ssqls.h</filename> and/or
- <filename>lib/querydef.h</filename> headers using Perl scripts with
- the same name, except with a <filename>pl</filename> extension.
- Instructions for this are at the top of each script.</para>
+ <para>Perhaps your database design does need more than 25
+ SSQLS fields or template query parameters. You can raise these
+ limits by re-generating the <filename>lib/ssqls.h</filename>
+ and/or <filename>lib/querydef.h</filename> headers. These
+ files are generated by Perl scripts of the same name,
+ except with a <filename>pl</filename> extension.</para>
- <para>If you’re on a platform that uses
- Autoconf<footnote><para>ditto</para></footnote>, you can change
- these scripts like you would any other part of the library. After
- making your changes, just say <command>make</command> to rebuild
- the library, including these headers. This requires a Perl
- interpreter on the system to work, but Perl is nearly ubiquitous
- on systems that also use autoconf these days.</para>
+ <para>The default <filename>querydef.h</filename> is small and
+ its size only increases linearly with respect to field count. Even
+ with an insanely large table, it shouldn’t be a problem to
+ increase this file’s field limit.</para>
- <para>On all other platforms, you’ll have to rebuild
- these headers by running Perl by hand. Just say <command>perl
- ssqls.pl</command> or <command>perl querydef.pl</command> in the
- <filename>lib</filename> subdirectory of the MySQL++ sources,
- then build the library as you normally would.</para>
+ <para>The reason we worry about large field counts exceeding
+ compiler limits is all down to <filename>ssqls.h</filename>. It
+ is already a rather large file with the default of 25
+ fields, at over 1 MB. Worse, its size goes up
+ <emphasis>quadratically</emphasis> as a function of
+ field count. Doubling the default nearly quadruples
+ the file size!<footnote><para>The amateur mathematician
+ reading this may be wondering, why doesn’t doubling
+ the field count exactly quadruple the file size, if
+ it’s a quadratic relationship? It’s because
+ the equation relating them has a few lower-order terms:
+ <phrase role="math">N<subscript>lines</subscript> =
+ 18.5f<superscript>2</superscript> + 454.5f + 196.4</phrase>,
+ where <varname>f</varname> is the field count.</para></footnote>
+ Thus the need for a field limit: many compilers have limits on the
+ size of preprocessor macros. It may be that the compiler you use
+ is able to cope with much larger macros than we like to generate
+ by default.</para>
+
+ <para>If you’re building MySQL++ from source on
+ a platform that uses Autoconf, the easiest way to change
+ these limits is at configuration time:</para>
+
+ <screen>
+./configure --with-field-limit=50</screen>
+
+ <para>That causes the configuration script to pass the
+ <command>-f</command> flag to the two Perl scripts named above,
+ overriding the default of 25 fields. Obviously you need a
+ Perl interpreter on the system for this to work, but Perl is
+ usually installed by default on systems MySQL++ supports via
+ Autoconf.</para>
+
+ <para>On all other platforms, you’ll have to give the
+ <command>-f</command> flag to these scripts yourself. This
+ may require installing Perl and putting it in the command
+ path first. Having done that, you can do something like this to
+ raise the limits:</para>
+
+ <screen>
+cd lib
+perl ssqls.pl -f 50
+perl querydef.pl -f 50</screen>
+
+ <para>Note the need to run these commands within the
+ <filename>lib</filename> subdirectory of the MySQL++ source
+ tree. (This is done for you automatically on systems where you
+ are able to use the Autoconf method.)</para>
</sect2>
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits