summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorDmitry Lenev <dlenev@mysql.com>2009-10-09 18:29:51 +0400
committerDmitry Lenev <dlenev@mysql.com>2009-10-09 18:29:51 +0400
commitd4669dc4127dc7225c37721a90bb003ba998bc1a (patch)
treec4607e249dbd8ca2aceceed09f6e3bd86c39c606 /sql/sql_parse.cc
parent0eccb93214fe11d60f4e95a813793357856e4ad7 (diff)
downloadmariadb-git-d4669dc4127dc7225c37721a90bb003ba998bc1a.tar.gz
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.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 20a0e65e27b..d9c9dda394d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6110,8 +6110,8 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
if (type_modifier & PRI_KEY_FLAG)
{
Key *key;
- lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
- key= new Key(Key::PRIMARY, NullS,
+ lex->col_list.push_back(new Key_part_spec(*field_name, 0));
+ key= new Key(Key::PRIMARY, null_lex_str,
&default_key_create_info,
0, lex->col_list);
lex->alter_info.key_list.push_back(key);
@@ -6120,8 +6120,8 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
Key *key;
- lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
- key= new Key(Key::UNIQUE, NullS,
+ lex->col_list.push_back(new Key_part_spec(*field_name, 0));
+ key= new Key(Key::UNIQUE, null_lex_str,
&default_key_create_info, 0,
lex->col_list);
lex->alter_info.key_list.push_back(key);