diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-12-10 02:32:00 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-12-10 02:32:00 +0200 |
commit | 2f6f08ed8862122a2f2d2b199e516fe5795acbbc (patch) | |
tree | f82405cb23d4ec6f6f576d4c0d0cdbcf68194160 /mysys | |
parent | 14a07e822dacb45cd79adc7a670b47a577a0dd82 (diff) | |
download | mariadb-git-2f6f08ed8862122a2f2d2b199e516fe5795acbbc.tar.gz |
Added MARIA_SHARE *share to a lot of places to make code simpler
Changed info->s -> share to get more efficent code
Updated arguments to page accessor functions to use MARIA_SHARE * instead of MARIA_HA *.
Tested running tests in quick mode (no balance page on insert and only when critical on delete)
Fixed bug in underflow handling in quick mode
Fixed bug in log handler where it accessed not initialized variable
Fixed bug in log handler where it didn't free mutex in unlikely error condition
Removed double write of page in case of of some underflow conditions
Added DBUG_PRINT in safemutex lock/unlock
dbug/dbug.c:
Compile without SAFE_MUTEX (to be able to use DBUG_PRINT in safe_mutex code)
Use calls to get/set my_thread_var->dbug. (Make dbug independent of compile time options for mysys)
include/my_pthread.h:
Added prototypes for my_thread_var_get_dbug() & my_thread_var_set_dbug()
mysql-test/lib/mtr_report.pl:
Don't check warnings in log files if we are using --extern
mysys/my_thr_init.c:
Added my_thread_var_get_dbug() & my_thread_var_set_dbug()
mysys/thr_mutex.c:
Added DBUG printing of addresses to mutex for lock/unlock
storage/maria/ma_blockrec.c:
Fixed comment
storage/maria/ma_check.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_close.c:
Indentation fixes
storage/maria/ma_create.c:
Calculate min_key_length correctly
storage/maria/ma_dbug.c:
Indentation fixes
storage/maria/ma_delete.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
Removed some writing of key pages that underflow (will be written by caller)
Fixed crashing bug in underflow handling when using quick mode
storage/maria/ma_delete_all.c:
Indentation fixes
storage/maria/ma_dynrec.c:
Indentation fixes
storage/maria/ma_extra.c:
Fixed indentation
Removed old useless code
Reset share->changed if we have written state
storage/maria/ma_ft_update.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_info.c:
Indentation fixes
storage/maria/ma_key_recover.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_locking.c:
Indentation fixes
storage/maria/ma_loghandler.c:
Removed wrapper functions translog_mutex_lock and translog_mutex_unlock (safemutex now does same kind of printing)
Renamed LOGREC_REDO_INSERT_ROW_BLOB to LOGREC_REDO_INSERT_NOT_USED to mark it free
Fixed some DBUG_PRINT to ensure that convert-dbug-for-diff works
Fixed bug in translog_flush() that caused log to stop syncing to disk
Added missing mutex_unlock in case of error
storage/maria/ma_loghandler.h:
Renamed LOGREC_REDO_INSERT_ROW_BLOB to LOGREC_REDO_INSERT_NOT_USED to mark it free
storage/maria/ma_open.c:
Indentation fixes
storage/maria/ma_packrec.c:
Indentation fixes
storage/maria/ma_page.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
Added check that we never write a key page without content (except in recovery where a key page may temporary be without content)
storage/maria/ma_preload.c:
Updated arguments to page accessor functions
storage/maria/ma_range.c:
Updated arguments to page accessor functions
storage/maria/ma_rkey.c:
Indentation fixes
storage/maria/ma_rprev.c:
Indentation fixes
storage/maria/ma_rt_index.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_rt_index.h:
Updated arguments to page accessor functions
storage/maria/ma_rt_key.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_rt_mbr.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_rt_split.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_search.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_sort.c:
Indentation fixes
storage/maria/ma_statrec.c:
Indentation fixes
storage/maria/ma_test1.c:
Added extra undo test
Flush also keys in -u1, to ensure that the full log is flushed
storage/maria/ma_test2.c:
Added extra undo test
Flush also keys in -u1, to ensure that the full log is flushed
storage/maria/ma_test_recovery.expected:
Updated results
storage/maria/ma_test_recovery:
Added extra undo test
storage/maria/ma_update.c:
Indentation fixes
storage/maria/ma_write.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
Prepare for quick mode for insert (don't balance page)
storage/maria/maria_chk.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/maria_def.h:
Updated arguments to page accessor functions
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_thr_init.c | 31 | ||||
-rw-r--r-- | mysys/thr_mutex.c | 12 |
2 files changed, 41 insertions, 2 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 1ba6e5ac92d..da61d32d35c 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -347,6 +347,9 @@ void my_thread_end(void) tmp->init= 0; #endif +#if !defined(__WIN__) || defined(USE_TLS) + pthread_setspecific(THR_KEY_mysys,0); +#endif /* Decrement counter for number of running threads. We are using this in my_thread_global_end() to wait until all threads have called @@ -359,10 +362,12 @@ void my_thread_end(void) pthread_cond_signal(&THR_COND_threads); pthread_mutex_unlock(&THR_LOCK_threads); } - /* The following free has to be done, even if my_thread_var() is 0 */ + else + { #if !defined(__WIN__) || defined(USE_TLS) - pthread_setspecific(THR_KEY_mysys,0); + pthread_setspecific(THR_KEY_mysys,0); #endif + } } struct st_my_thread_var *_my_thread_var(void) @@ -380,6 +385,28 @@ struct st_my_thread_var *_my_thread_var(void) return tmp; } +extern void *my_thread_var_get_dbug(my_bool *error) +{ + struct st_my_thread_var *tmp= + my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys); + my_bool tmp_error; + if (!error) + error= &tmp_error; + if (tmp) + { + *error= 0; + return tmp->dbug; + } + *error= 1; /* no THR_KEY_mysys */ + return (void*) 0; +} + +extern void my_thread_var_set_dbug(void *dbug) +{ + struct st_my_thread_var *tmp= _my_thread_var(); + tmp->dbug= dbug; +} + /**************************************************************************** Get name of current thread. diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index e7a927e562a..839cbc133df 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -94,6 +94,10 @@ int safe_mutex_init(safe_mutex_t *mp, int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line) { int error; +#ifndef DBUG_OFF + if (my_thread_var_get_dbug((my_bool*) 0)) + DBUG_PRINT("mutex", ("Locking mutex: 0x%lx", (ulong) mp)); +#endif if (!mp->file) { fprintf(stderr, @@ -131,6 +135,10 @@ line %d more than 1 time\n", file,line); mp->file= file; mp->line=line; pthread_mutex_unlock(&mp->global); +#ifndef DBUG_OFF + if (my_thread_var_get_dbug((my_bool*) 0)) + DBUG_PRINT("mutex", ("mutex: 0x%lx locked", (ulong) mp)); +#endif return error; } @@ -138,6 +146,10 @@ line %d more than 1 time\n", file,line); int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line) { int error; +#ifndef DBUG_OFF + if (my_thread_var_get_dbug((my_bool*) 0)) + DBUG_PRINT("mutex", ("Unlocking mutex 0x%lx", (ulong) mp)); +#endif pthread_mutex_lock(&mp->global); if (mp->count == 0) { |