1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

This patch is prerequisite for the 2nd milestone of WL#148 "Foreign keys"

storing and restoring information about foreign keys in the .FRM files and
properly displaying it in SHOW CREATE TABLE output and I_S tables.

The idea of this patch is to change type of Key_part_spec::field_name and
Key::name to LEX_STRING in order to avoid extra strlen() calls during
semantic analysis and statement execution, particularly, in code to be
implemented on the 2nd milestone of WL#148.

Note that since we are not using LEX_STRING everywhere yet (e.g. in
Create_field and KEY) and we want to limit scope of our changes we
have to do strlen() in places where we create Key and Key_part_spec
instances from objects using plain (char*) for strings. These calls
will go away during the process of further (char*) -> LEX_STRING
refactoring.

We have introduced these changes in 6.0 and backported them to 5.5
tree to make people aware of these changes as early as possible and
to simplify merges with mysql-fk and mysql-6.1-fk trees.

No test case is needed since this patch does not introduce any
user visible changes.
This commit is contained in:
Dmitry Lenev
2009-10-09 18:29:51 +04:00
parent 0eccb93214
commit d4669dc412
7 changed files with 76 additions and 58 deletions

View File

@ -90,7 +90,9 @@ extern "C" void free_user_var(user_var_entry *entry)
bool Key_part_spec::operator==(const Key_part_spec& other) const
{
return length == other.length && !strcmp(field_name, other.field_name);
return length == other.length &&
field_name.length == other.field_name.length &&
!strcmp(field_name.str, other.field_name.str);
}
/**