Bug #96646 rewrite_rules table's `pattern_database` column from Query Rewrite is short
Submitted: 26 Aug 2019 4:26 Modified: 26 Aug 2019 7:38
Reporter: hao chen Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S4 (Feature request)
Version:5.7.24 OS:Any
Assigned to: CPU Architecture:Any
Tags: Query Rewrite

[26 Aug 2019 4:26] hao chen
Description:
   We kown the database name have a maximum length  of 64 bits,here is the `Db` column from  mysql.db table structure :

    `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',

but in query rewrite plugin ,the pattern_database column that match the database name field from query_rewrite.rewrite_rules is just 20 bits,here is the `pattern_database` column from query_rewrite.rewrite_rules table structure :

    pattern_database VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,

therefore,if one database name is greater than 20 bits , this results in the database name not being written in the query_rewrite.rewrite_rule table;

How to repeat:
Increase the default length of the  pattern_database field .
[26 Aug 2019 7:38] MySQL Verification Team
Hello hao chen,

Thank you for the report.
Marking this as duplicate of Bug #96647, please see Bug #96647

regards,
Umesh