List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 20 1999 2:28am
Subject:Re: Length of Database name field inconsistent
View as plain text  
At 7:57 PM -0600 3/19/1999, Tauren Mills wrote:
>Why is the size of the db field in the different root database tables
>different?  In some of them it is char(32) (db and host), in others it is
>char(60) (columns_priv, tables_priv).
>
>I assume that a database name cannot be more than 32 characters long?  Is
>this correct?

According to the manual, a database name can be up to 64 characters
long (ch. 7):

>@item
>A database, table, index or column name can be up to 64 characters long. An
>alias name can be up to 256 characters long.

??? The Db field is not 32 characters long in any grant table.  How
do you get that figure?  The field is 64 characters long in both the
db and host tables:

mysql> describe db; describe host;
+-----------------+---------------+------+-----+---------+-------+
| Field           | Type          | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| Host            | char(60)      |      | PRI |         |       |
| Db              | char(64)      |      | PRI |         |       |
| User            | char(16)      |      | PRI |         |       |
....
+-----------------+---------------+------+-----+---------+-------+

+-----------------+---------------+------+-----+---------+-------+
| Field           | Type          | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| Host            | char(60)      |      | PRI |         |       |
| Db              | char(64)      |      | PRI |         |       |
....
+-----------------+---------------+------+-----+---------+-------+
13 rows in set (0.00 sec)


The Db field is 60 characters long in the columns_priv and
tables_priv tables as a compromise due to the maximum size of
an index row being 256 bytes.

--
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/
Thread
Length of Database name field inconsistentTauren Mills20 Mar
  • Re: Length of Database name field inconsistentPaul DuBois20 Mar
    • RE: Length of Database name field inconsistentTauren Mills20 Mar
      • RE: Length of Database name field inconsistentPaul DuBois20 Mar
        • RE: Length of Database name field inconsistentTauren Mills20 Mar
RE: Length of Database name field inconsistentTauren Mills26 Mar
  • RE: Length of Database name field inconsistentMichael Widenius28 Mar
Re: Length of Database name field inconsistentEd Carp28 Mar