summaryrefslogtreecommitdiff
path: root/mysys/mf_pack.c
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-11-23 22:45:02 +0200
committermonty@mysql.com <>2005-11-23 22:45:02 +0200
commite42c98096746bc675e0c6d6b45776937d7cfb05b (patch)
treeafbb980a4dee7a0c8ab8d00768780e383e0e50fe /mysys/mf_pack.c
parentb167a6679bbb8b66abf838d3c636bdefb6379a2f (diff)
downloadmariadb-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 'mysys/mf_pack.c')
-rw-r--r--mysys/mf_pack.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index 049aa59a578..9dd2a6a8276 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -107,16 +107,27 @@ void pack_dirname(my_string to, const char *from)
} /* pack_dirname */
- /* remove unwanted chars from dirname */
- /* if "/../" removes prev dir; "/~/" removes all before ~ */
- /* "//" is same as "/", except on Win32 at start of a file */
- /* "/./" is removed */
- /* Unpacks home_dir if "~/.." used */
- /* Unpacks current dir if if "./.." used */
+/*
+ remove unwanted chars from dirname
-uint cleanup_dirname(register my_string to, const char *from)
- /* to may be == from */
+ SYNOPSIS
+ cleanup_dirname()
+ to Store result here
+ from Dirname to fix. May be same as to
+
+ IMPLEMENTATION
+ "/../" removes prev dir
+ "/~/" removes all before ~
+ //" is same as "/", except on Win32 at start of a file
+ "/./" is removed
+ Unpacks home_dir if "~/.." used
+ Unpacks current dir if if "./.." used
+ RETURN
+ # length of new name
+*/
+
+uint cleanup_dirname(register my_string to, const char *from)
{
reg5 uint length;
reg2 my_string pos;