From: Paul DuBois Date: March 20 1999 2:28am Subject: Re: Length of Database name field inconsistent List-Archive: http://lists.mysql.com/mysql/673 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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/