diff options
author | monty@mysql.com <> | 2005-11-23 22:45:02 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2005-11-23 22:45:02 +0200 |
commit | e42c98096746bc675e0c6d6b45776937d7cfb05b (patch) | |
tree | afbb980a4dee7a0c8ab8d00768780e383e0e50fe /sql/parse_file.cc | |
parent | b167a6679bbb8b66abf838d3c636bdefb6379a2f (diff) | |
download | mariadb-git-e42c98096746bc675e0c6d6b45776937d7cfb05b.tar.gz |
Table definition cache, part 2
The table opening process now works the following way:
- Create common TABLE_SHARE object
- Read the .frm file and unpack it into the TABLE_SHARE object
- Create a TABLE object based on the information in the TABLE_SHARE
object and open a handler to the table object
Other noteworthy changes:
- In TABLE_SHARE the most common strings are now LEX_STRING's
- Better error message when table is not found
- Variable table_cache is now renamed 'table_open_cache'
- New variable 'table_definition_cache' that is the number of table defintions that will be cached
- strxnmov() calls are now fixed to avoid overflows
- strxnmov() will now always add one end \0 to result
- engine objects are now created with a TABLE_SHARE object instead of a TABLE object.
- After creating a field object one must call field->init(table) before using it
- For a busy system this change will give you:
- Less memory usage for table object
- Faster opening of tables (if it's has been in use or is in table definition cache)
- Allow you to cache many table definitions objects
- Faster drop of table
Diffstat (limited to 'sql/parse_file.cc')
-rw-r--r-- | sql/parse_file.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/parse_file.cc b/sql/parse_file.cc index d3e5645bafc..4633261e4ed 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -355,11 +355,11 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name, { char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN]; - strxnmov(old_path, FN_REFLEN, mysql_data_home, "/", schema, "/", + strxnmov(old_path, FN_REFLEN-1, mysql_data_home, "/", schema, "/", old_name, reg_ext, NullS); (void) unpack_filename(old_path, old_path); - strxnmov(new_path, FN_REFLEN, mysql_data_home, "/", schema, "/", + strxnmov(new_path, FN_REFLEN-1, mysql_data_home, "/", schema, "/", new_name, reg_ext, NullS); (void) unpack_filename(new_path, new_path); @@ -367,7 +367,7 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name, return 1; /* check if arc_dir exists */ - strxnmov(arc_path, FN_REFLEN, mysql_data_home, "/", schema, "/arc", NullS); + strxnmov(arc_path, FN_REFLEN-1, mysql_data_home, "/", schema, "/arc", NullS); (void) unpack_filename(arc_path, arc_path); if (revision > 0 && !access(arc_path, F_OK)) @@ -414,7 +414,7 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root, char *end, *sign; File_parser *parser; File file; - DBUG_ENTER("sql__parse_prepare"); + DBUG_ENTER("sql_parse_prepare"); if (!my_stat(file_name->str, &stat_info, MYF(MY_WME))) { |