This is needed as a pre-requisite for a few other tasks.
Create_field::field_name and Field::field_name will be changed from "const char *" to a LEX_CSTRNG-alike structure, so both pointer and length are stored.
This will help to:
1. Avoid strlen() in some cases
2. Put typical operations that are done on field names into method, to reuse the code (e.g. name comparision)
3. Improve performance of name comparison. Currently field names are compared as follows:
If we store length, the method comparing names could immediately return false if lengths are different.
4. Simplify sql_yacc.yy, so data in various formats (LEX_CSTRING, LEX_STRING, const char *) will be easier to reuse.
(in separate tasks)
5. Make Field and Create_field closer to sp_variable, which is useful for the data type handlers. All these three classes could share some members and methods.
Note, under terms of this task we won't change Item::name. It still will be of type "const char *".
That means that we'll have to use strlen(item->name) when creating a Create_field or a Field from Item.
This is Okey for now, in long terms we'll change Item::name as well and get rid of strlen().