-
Gopal Shankar authored
MAXIMUM PATH LENGTH Problem: Currently mysqld limits the max path char's to FN_REFLEN(512). When mysqld tries to create frm file or database directory it does not report error in case path is greater FN_REFLEN, but it does truncate the path to FN_REFLEN char and continue creating frm file or database directory with truncated name!! Analysis: Mysql limits database_name/table_name identifier to max of 64 characters. The frm file or directory are created using characters from identifiers itself, so it cannot exceed 128+1(for /) characters. However, with UTF8 char in identifier we end-up creating frm file or directory name with 5 char per UTF8 char in identifier. This will be give us max of (64*5)+1(/)+(64*5) = 641 char, which is much higher than FN_REFLEN. We can consider increasing this limit FN_REFLEN, but the effort required to do that is more, and is not prefered now. Fix: 'CREATE TABLE', 'ALTER...RENAME', 'RENAME...TO' and 'CREATE DATABASE' are only DDL's which can hit the limit. The current approach is the make sure these path give proper error to users. We check if path length to create frm file or database directory hits the limit FN_REFLEN, if yes we throw a new error ER_PATH_TOO_LONG.
Gopal Shankar authoredMAXIMUM PATH LENGTH Problem: Currently mysqld limits the max path char's to FN_REFLEN(512). When mysqld tries to create frm file or database directory it does not report error in case path is greater FN_REFLEN, but it does truncate the path to FN_REFLEN char and continue creating frm file or database directory with truncated name!! Analysis: Mysql limits database_name/table_name identifier to max of 64 characters. The frm file or directory are created using characters from identifiers itself, so it cannot exceed 128+1(for /) characters. However, with UTF8 char in identifier we end-up creating frm file or directory name with 5 char per UTF8 char in identifier. This will be give us max of (64*5)+1(/)+(64*5) = 641 char, which is much higher than FN_REFLEN. We can consider increasing this limit FN_REFLEN, but the effort required to do that is more, and is not prefered now. Fix: 'CREATE TABLE', 'ALTER...RENAME', 'RENAME...TO' and 'CREATE DATABASE' are only DDL's which can hit the limit. The current approach is the make sure these path give proper error to users. We check if path length to create frm file or database directory hits the limit FN_REFLEN, if yes we throw a new error ER_PATH_TOO_LONG.
Loading