On Friday 19 October 2007, Markus Gritsch wrote:
> On 10/19/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> > Hello!
>
> Hi Oleg,
>
> > On Fri, Oct 19, 2007 at 09:39:05AM +0200, Markus Gritsch wrote:
> > > in SQLObject a BoolCol() is stored as TINYINT(4) in the MySQL
> > > backend and as TINYINT in the SQLite backend.  Both are not optimal
> > > IMO:
> >
> >    Booleans are stored as TINYINT which is TINYINT(1). Why do you
> > think it is TINYINT(4)?!
> >
> > See http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html
>
> From this page I cannot tell that TINYINT is the equivalent to
> TINYINT(1), maybe I just didn't see it.

That page clearly states that tinyint uses 1 byte and then a paragraph 
below it says this:

-------------
Another extension is supported by MySQL for optionally specifying the 
display width of integer data types in parentheses following the base 
keyword for the type (for example, INT(4)). This optional display width 
is used to display integer values having a width less than the width 
specified for the column by left-padding them with spaces. 
 The display width does not constrain the range of values that can be 
stored in the column, nor the number of digits that are displayed for 
values having a width exceeding that specified for the column. For 
example, a column specified as SMALLINT(3) has the usual SMALLINT range 
of -32768 to 32767, and values outside the range allowed by three 
characters are displayed using more than three characters.
-------------

Which I believe pretty much explains that it doesn't really matter if it 
is tinyint(1) or tinyint(4) (the default), as I explained in the previous 
email.

-- 
Dan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to