List:Internals« Previous MessageNext Message »
From:Sasha Pachev Date:November 27 2000 3:04pm
Subject:Re: mysql.db constraints
View as plain text  
On Sunday 26 November 2000 20:45, Ryan W. Maple wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>
>Greetings,
>
>I recently ran across this problem when using a very long database name.
>As I understand it, the database name can be as long as you want depending
>on your platform.  I am not sure of the max size of a Linux directory off
>the top of my head but I know it can be very long.
>
>So the proof-of-concept below illustrates my problem.  I have a
>46-character database name:
>"this_is_a_really_really_long_table_that_breaks".
>
>When I attempt to perform access control, using the mysql.db table, my
>entry gets truncated down to 32 characters
>("this_is_a_really_really_long_tab") since the mysql.db Db field is set to
>be 32 at most.
>
>So I'm assuming this is done for OS's that have a small limit (Windows
>comes to mind but again, I'm not positive).  So my question is:  If I
>alter this size to say, 64 characters... would that break anything
>internally?
>
>I'm assuming that it will not but haven't looked at the source code yet.
>
>For the record, I am using 3.22.32 on Linux 2.2.x.
>
>Any insight would be appreciated.  I can easily tweak this myself but I
>wanted to make sure that nothing "internal" would break as a result.
>
>Cheers,
>Ryan
>
> +-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --+
>   Ryan W. Maple          "I dunno, I dream in Perl sometimes..."  -LW
>   Guardian Digital, Inc.                     ryan@stripped
> +-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --+
>
>
>- ----- BEGIN PROOF OF CONCEPT -----
>mysql> SHOW DATABASES;
>+------------------------------------------------+
>| Database                                       |
>+------------------------------------------------+
>| mysql                                          |
>| this_is_a_really_really_long_table_that_breaks |
>+------------------------------------------------+
>5 rows in set (0.00 sec)
>
>mysql> SELECT User, Host, DB FROM mysql.db;
>+------------+-----------+----------------------------------+
>| User       | Host      | DB                               |
>+------------+-----------+----------------------------------+
>| root       | localhost | this_is_a_really_really_long_tab |
>+------------+-----------+----------------------------------+
>3 rows in set (0.00 sec)
>
>mysql> DESCRIBE mysql.db;
>+-----------------+---------------+------+-----+---------+-------+
>| Field           | Type          | Null | Key | Default | Extra |
>+-----------------+---------------+------+-----+---------+-------+
>| Host            | char(60)      |      | PRI |         |       |
>| Db              | char(32)      |      | PRI |         |       |
>| User            | char(16)      |      | PRI |         |       |
>| Select_priv     | enum('N','Y') |      |     | N       |       |
>| Insert_priv     | enum('N','Y') |      |     | N       |       |
>| Update_priv     | enum('N','Y') |      |     | N       |       |
>| Delete_priv     | enum('N','Y') |      |     | N       |       |
>| Create_priv     | enum('N','Y') |      |     | N       |       |
>| Drop_priv       | enum('N','Y') |      |     | N       |       |
>| Grant_priv      | enum('N','Y') |      |     | N       |       |
>| References_priv | enum('N','Y') |      |     | N       |       |
>| Index_priv      | enum('N','Y') |      |     | N       |       |
>| Alter_priv      | enum('N','Y') |      |     | N       |       |
>+-----------------+---------------+------+-----+---------+-------+
>13 rows in set (0.00 sec)
>- ----- END PROOF OF CONCEPT -----


Thanks for the bug report. To fix, to ALTER TABLE mysql.db MODIFY db CHAR(64) 
NOT NULL. We will fix this in the next release.

-- 
MySQL Development Team
   __  ___     ___ ____  __ 
  /  |/  /_ __/ __/ __ \/ /   Sasha Pachev <sasha@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Provo, Utah, USA
       <___/                  
Thread
mysql.db constraintsRyan W. Maple27 Nov
  • Re: mysql.db constraintsBeotel27 Nov
  • Re: mysql.db constraintsRussell E Glaue27 Nov
    • LOCALSTATEDIR or DATADIR (Documentation Error ?)Russell E Glaue1 Dec
  • Re: mysql.db constraintsSasha Pachev27 Nov