diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-16 20:19:10 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-16 20:19:10 +0200 |
commit | bd1c2d65c46a433e4ea53858584dc987b1b75658 (patch) | |
tree | 9cac640546f7a1615d184835e8fea1d18456e4e5 /mysys/my_alloc.c | |
parent | ffd1d3df2ab2c46225667e71ed04f2f47ecaef32 (diff) | |
download | mariadb-git-bd1c2d65c46a433e4ea53858584dc987b1b75658.tar.gz |
Small improvement to alloc_root
Add support for LIMIT # OFFSET #
Changed lock handling: Now all locks should be stored in TABLE_LIST instead of passed to functions.
Don't call query_cache_invalidate() twice in some cases
mysql_change_user() now clears states to be equal to close + connect.
Fixed a bug with multi-table-update and multi-table-delete when used with LOCK TABLES
Fixed a bug with replicate-do and UPDATE
BitKeeper/etc/ignore:
added autom4te.cache/* bdb/dist/autom4te.cache/* innobase/autom4te.cache/*
include/my_alloc.h:
Small improvement to alloc_root
libmysql/libmysql.c:
Removed compiler warning
myisam/mi_page.c:
Better DBUG message
mysql-test/r/multi_update.result:
Added test with lock tables
mysql-test/r/rpl_replicate_do.result:
Update results
mysql-test/r/rpl_rotate_logs.result:
Make test independent of if t1 exists
mysql-test/t/multi_update.test:
Added test with lock tables
mysql-test/t/rpl_rotate_logs.test:
Make test independent of if t1 exists
mysys/my_alloc.c:
Small imprevement to alloc_root
(Don't free blocks less than ALLOC_MAX_BLOCK_ROOT (4K)
sql/ha_innodb.cc:
More debug messages
sql/ha_myisam.cc:
Safety change
sql/lex.h:
Add support for LIMIT # OFFSET #
sql/lock.cc:
Added assertion
sql/mysql_priv.h:
Change of lock handling
sql/mysqld.cc:
Added function clear_error_messages()
sql/sql_base.cc:
Change lock handling by open_ltable() and open_and_lock_tables()
sql/sql_class.cc:
Split THD::THD to two functions
Move some code from cleanup() to ~THD:THD
Add THD::change_user()
sql/sql_class.h:
Prototype changes in class THD
sql/sql_delete.cc:
Remove locking argument from mysql_delete()
Locking type is now stored in TABLE_LIST
Small code change to not call query_cache_invalidate() twice for transactional tables.
sql/sql_insert.cc:
Remove locking argument from mysql_insert()
Locking type is now stored in TABLE_LIST
Small code change to not call query_cache_invalidate() twice for transactional tables.
Don't use bulk insert if bulk_insert_buff_size is 0
sql/sql_parse.cc:
Changes to make mysql_change_user() work as close+connect
Changed command statistics to use statstics_increment to get more speed
Update code to handle that locks is now stored in TABLE_LIST
sql/sql_update.cc:
Remove locking argument from mysql_update()
Locking type is now stored in TABLE_LIST
Small code change to not call query_cache_invalidate() twice for transactional tables.
sql/sql_yacc.yy:
Locking type is now stored in TABLE_LIST
Added support for LIMIT # OFFSET # syntax
Removed some wrong (never true) checks for SQLCOM_MULTI_UPDATE
mysql-test/t/rpl_replicate_do-slave.opt:
Changed tables to use t1,t2,...
mysql-test/t/rpl_replicate_do.test:
Changed tables to use t1,t2,...
Diffstat (limited to 'mysys/my_alloc.c')
-rw-r--r-- | mysys/my_alloc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index f494cce8dbe..1ab86476e41 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -29,7 +29,7 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, mem_root->min_malloc= 32; mem_root->block_size= block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8; mem_root->error_handler= 0; - mem_root->block_num= 0; + mem_root->block_num= 4; /* We shift this with >>2 */ mem_root->first_block_usage= 0; #if !(defined(HAVE_purify) && defined(EXTRA_DEBUG)) if (pre_alloc_size) @@ -69,10 +69,11 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) reg2 USED_MEM **prev; Size= ALIGN_SIZE(Size); - if ( (*(prev= &mem_root->free)) != NULL ) + if ((*(prev= &mem_root->free)) != NULL) { - if( (*prev)->left < Size && - mem_root->first_block_usage++ >= MAX_BLOCK_USAGE_BEFORE_DROP ) + if ((*prev)->left < Size && + mem_root->first_block_usage++ >= ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP && + (*prev)->left < ALLOC_MAX_BLOCK_TO_DROP) { next= *prev; *prev= next->next; /* Remove block from list */ @@ -85,7 +86,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) } if (! next) { /* Time to alloc new block */ - block_size= mem_root->block_size*((mem_root->block_num>>2)+1); + block_size= mem_root->block_size * (mem_root->block_num >> 2); get_size= Size+ALIGN_SIZE(sizeof(USED_MEM)); get_size= max(get_size, block_size); @@ -177,10 +178,8 @@ void free_root(MEM_ROOT *root, myf MyFlags) root->free=root->pre_alloc; root->free->left=root->pre_alloc->size-ALIGN_SIZE(sizeof(USED_MEM)); root->free->next=0; - root->block_num= 1; } - else - root->block_num= 0; + root->block_num= 4; root->first_block_usage= 0; DBUG_VOID_RETURN; } |