List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:January 25 2002 6:02pm
Subject:Re: MySQL Checkbox table field
View as plain text  
In the last episode (Jan 25), Michael Collins said:
> At 11:32 AM -0600 1/25/02, Dan Nelson wrote:
> >Why would the MySQL TODO mention an MS SQL feature? :)
> 
> Because the MySQL team wants to add a feature that is found in
> another DBMS?

According to the Mysql manual, the bit type was added in 3.21.12.
 
> >OK, so it's actually a synonym for tinyint(1).
> 
> I could not find a reference to the synonym in the MySQL 
> documentation (in the data type section).

Under Column Types (http://www.mysql.com/doc/C/o/Column_types.html):

`BIT' `BOOL' `CHAR'
     These three are synonyms for `CHAR(1)'.
 
> Question remains, can one effectively index tinyint(1)?

You didn't read the message you replied to :)

> > mysql> create table test ( myfield bit primary key );
> > Query OK, 0 rows affected (0.01 sec)
> >
> > mysql> desc test;
> > +---------+------------+------+-----+---------+-------+
> > | Field   | Type       | Null | Key | Default | Extra |
> > +---------+------------+------+-----+---------+-------+
> > | myfield | tinyint(1) |      | PRI | 0       |       |
> > +---------+------------+------+-----+---------+-------+
> > 1 row in set (0.88 sec)

Note the describe command shows the field type as tinyint(1), and there
is a primary key on the column.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Re: MySQL Checkbox table fieldVernon A Webb25 Jan
Re: MySQL Checkbox table fieldMichael Collins25 Jan
  • Re: MySQL Checkbox table fieldDan Nelson25 Jan
    • Re: MySQL Checkbox table fieldMichael Collins25 Jan
      • Re: MySQL Checkbox table fieldDan Nelson25 Jan
        • Re: MySQL Checkbox table fieldMichael Collins25 Jan
          • Re: MySQL Checkbox table fieldDan Nelson25 Jan
            • Re: MySQL Checkbox table fieldMichael Collins25 Jan
RE: MySQL Checkbox table fieldTodd Williamsen25 Jan
RE: MySQL Checkbox table fieldJames E. Hicks III25 Jan
RE: MySQL Checkbox table fieldMatthew Walker25 Jan
  • RE: MySQL Checkbox table fieldPaul DuBois25 Jan
Re: MySQL Checkbox table fieldDavid Shields25 Jan
RE: MySQL Checkbox table fieldMatthew Walker25 Jan
  • RE: MySQL Checkbox table fieldPaul DuBois25 Jan