Author: wyoung
Date: Wed Jul 2 17:22:57 2008
New Revision: 2300
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2300&view=rev
Log:
Minor text tweaks to discussion of customizing the SSQLS mechanism.
Modified:
trunk/doc/userman/ssqls.dbx
Modified: trunk/doc/userman/ssqls.dbx
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/doc/userman/ssqls.dbx?rev=2300&r1=2299&r2=2300&view=diff
==============================================================================
--- trunk/doc/userman/ssqls.dbx (original)
+++ trunk/doc/userman/ssqls.dbx Wed Jul 2 17:22:57 2008
@@ -610,65 +610,66 @@
<sect2 id="ssqls-customization">
<title>Customizing the SSQLS Mechanism</title>
- <para>The SSQLS header <filename>ssqls.h</filename> is automatically
- generated by the Perl script <filename>ssqls.pl</filename>. Although
- it is possible to change this script to get additional
- functionality, most of the time it’s better to just derive a
- custom class from the stock SSQLS and add your additional
- functionality that way.</para>
+ <para>The SSQLS header <filename>ssqls.h</filename>
+ is automatically generated by the Perl script
+ <filename>ssqls.pl</filename>. Although it is possible to
+ change this script to get additional functionality, most of
+ the time it’s better to just derive a custom class from
+ the generated SSQLS to add functionality to it.</para>
<para>That said, <filename>ssqls.pl</filename> does have a few
configurables you might want to tweak.</para>
- <para>The first configurable value sets the maximum number of data
- members allowed in an SSQLS. It’s 25 out of the box, set by
- the <varname>$max_data_members</varname> variable at the top of
- <filename>ssqls.pl</filename>. Beware, making this value larger
- increases the size of <filename>ssqls.h</filename> exponentially;
- this will increase compile time, and can even expose limits in your
- compiler. Before you increase this value, take a good, hard look at
- your database schema and ask if it’s really the best design.
- Almost always, having so many columns is a sign that you need to
- refactor the table.</para>
+ <para>The first configurable value sets the maximum number of
+ data members allowed in an SSQLS. It’s 25 out of the box,
+ set by the <varname>$max_data_members</varname> variable at
+ the top of <filename>ssqls.pl</filename>. Beware, making this
+ value larger increases the size of <filename>ssqls.h</filename>
+ exponentially; this will increase compile time, and can even make
+ the file uncompilable due to compiler limits. Before you increase
+ this value, take a good, hard look at your database schema and ask
+ if it’s really the best design. Almost always, having so
+ many columns is a sign that you need to refactor the table.</para>
<para>The second configurable is the default floating point
precision used for comparison. As described above (<xref
linkend="ssqls-compare-init"/>) SSQLSes can be compared for
equality. The only place this is tricky is with floating-point
numbers, since rounding errors can make two “equal”
- values compare as distinct. Since exact comparison makes no sense
- with floating-point values, MySQL++ lets you specify the precision
- you want it to use. If the difference between two values is under a
- given threshold, MySQL++ considers the values equal. The default
- threshold is 0.00001. This threshold works well for
- “human” scale values, but because of the way
- floating-point numbers work, it can be wildly inappropriate for very
- large or very small quantities like those used in scientific
+ values compare as distinct. This property of floating-point numbers
+ means we almost never want to do exact comparison. MySQL++ lets
+ you specify the precision you want it to use. If the difference
+ between two values is under a given threshold, MySQL++ considers
+ the values equal. The default threshold is 0.00001. This threshold
+ works well for “human” scale values, but because of the
+ way floating-point numbers work, it can be wildly inappropriate for
+ very large or very small quantities like those used in scientific
applications.</para>
- <para>There are actually two ways to change this threshold. If you
- need a different system-wide default, edit
- <filename>ssqls.pl</filename> and change the
+ <para>There are actually two ways to change this
+ threshold. If you need a different system-wide default,
+ edit <filename>ssqls.pl</filename> and change the
<varname>$fp_min_delta</varname> variable at the top of the file,
- then rebuild <filename>ssqls.h</filename> as described below. If you
- need different thresholds per file or per project, it’s better
- to set the C macro <varname>MYSQLPP_FP_MIN_DELTA</varname> instead.
- The Perl variable sets this macro’s default; if you give a
- different value before #including <filename>ssqls.h</filename>, it
- will use that instead.</para>
+ then rebuild <filename>ssqls.h</filename> as described below. If
+ you need different thresholds per file or per project, it’s
+ better to set the C macro <varname>MYSQLPP_FP_MIN_DELTA</varname>
+ instead. The Perl variable sets this macro’s
+ default; if you give a different value before #including
+ <filename>ssqls.h</filename>, it will use that instead.</para>
<para>To rebuild <filename>ssqls.h</filename> after changing
- <filename>ssqls.pl</filename>, you’ll need a Perl interpreter.
- The only modern Unixy system I’m aware of where Perl
- isn’t installed by default is Cygwin, and it’s just a
- <filename>setup.exe</filename> choice away there. You’ll
- probably only have to download and install a Perl interpreter if
- you’re on Windows and don’t want to use Cygwin.</para>
+ <filename>ssqls.pl</filename>, you’ll need a Perl
+ interpreter. The only modern Unixy system I’m aware
+ of where Perl isn’t installed by default is Cygwin, and
+ it’s just a <filename>setup.exe</filename> choice away
+ there. You’ll probably only have to download and install a
+ Perl interpreter if you’re on Windows and don’t want
+ to use Cygwin.</para>
<para>If you’re on a system that uses autoconf, building
- MySQL++ automatically updates <filename>ssqls.h</filename> any time
- <filename>ssqls.pl</filename> changes. Otherwise, you’ll need
- to run the Perl interpreter by hand:</para>
+ MySQL++ automatically updates <filename>ssqls.h</filename>
+ any time <filename>ssqls.pl</filename> changes. Otherwise,
+ you’ll need to run the Perl interpreter by hand:</para>
<screen>c:\mysql++> cd lib
c:\lib> perl ssqls.pl</screen>
@@ -692,6 +693,8 @@
think you can use <classname>std::string</classname> instead of
<classname>sql_blob</classname>, but the current design of
<classname>String</classname> converts to
+
+
<classname>std::string</classname> via a C string. As a result, the
BLOB data is truncated at the first embedded null character during
population of the SSQLS. There’s no way to fix that without
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits