mirror of
https://github.com/MariaDB/server.git
synced 2025-07-07 06:01:31 +03:00
Fixed compiler warnings
Fixed compile-pentium64 scripts Fixed wrong estimate of update_with_key_prefix in sql-bench Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1 Fixed unsafe define of uint4korr() Fixed that --extern works with mysql-test-run.pl Small trivial cleanups This also fixes a bug in counting number of rows that are updated when we have many simultanous queries Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc Split handle_one_connection() into reusable sub functions. Split create_new_thread() into reusable sub functions. Added thread_scheduler; Preliminary interface code for future thread_handling code. Use 'my_thread_id' for internal thread id's Make thr_alarm_kill() to depend on thread_id instead of thread Make thr_abort_locks_for_thread() depend on thread_id instead of thread In store_globals(), set my_thread_var->id to be thd->thread_id. Use my_thread_var->id as basis for my_thread_name() The above changes makes the connection we have between THD and threads more soft. Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions Fixed compiler warnings Fixed core dumps when running with --debug Removed setting of signal masks (was never used) Made event code call pthread_exit() (portability fix) Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called. Made handling of thread_id and thd->variables.pseudo_thread_id uniform. Removed one common 'not freed memory' warning from mysqltest Fixed a couple of usage of not initialized warnings (unlikely cases) Suppress compiler warnings from bdb and (for the moment) warnings from ndb
This commit is contained in:
@ -243,7 +243,7 @@ THD::THD()
|
||||
time_after_lock=(time_t) 0;
|
||||
current_linfo = 0;
|
||||
slave_thread = 0;
|
||||
variables.pseudo_thread_id= 0;
|
||||
thread_id= variables.pseudo_thread_id= 0;
|
||||
one_shot_set= 0;
|
||||
file_id = 0;
|
||||
query_id= 0;
|
||||
@ -267,9 +267,6 @@ THD::THD()
|
||||
cleanup_done= abort_on_warning= no_warnings_for_error= 0;
|
||||
peer_port= 0; // For SHOW PROCESSLIST
|
||||
transaction.m_pending_rows_event= 0;
|
||||
#ifdef __WIN__
|
||||
real_id = 0;
|
||||
#endif
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
active_vio = 0;
|
||||
#endif
|
||||
@ -401,6 +398,8 @@ void THD::change_user(void)
|
||||
void THD::cleanup(void)
|
||||
{
|
||||
DBUG_ENTER("THD::cleanup");
|
||||
DBUG_ASSERT(cleanup_done == 0);
|
||||
|
||||
#ifdef ENABLE_WHEN_BINLOG_WILL_BE_ABLE_TO_PREPARE
|
||||
if (transaction.xid_state.xa_state == XA_PREPARED)
|
||||
{
|
||||
@ -436,7 +435,6 @@ void THD::cleanup(void)
|
||||
pthread_mutex_lock(&LOCK_user_locks);
|
||||
item_user_lock_release(ull);
|
||||
pthread_mutex_unlock(&LOCK_user_locks);
|
||||
ull= 0;
|
||||
}
|
||||
|
||||
cleanup_done=1;
|
||||
@ -550,7 +548,9 @@ void THD::awake(THD::killed_state state_to_set)
|
||||
killed= state_to_set;
|
||||
if (state_to_set != THD::KILL_QUERY)
|
||||
{
|
||||
thr_alarm_kill(real_id);
|
||||
thr_alarm_kill(thread_id);
|
||||
if (!slave_thread)
|
||||
thread_scheduler.post_kill_notification(this);
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
close_active_vio();
|
||||
#endif
|
||||
@ -601,18 +601,19 @@ bool THD::store_globals()
|
||||
Assert that thread_stack is initialized: it's necessary to be able
|
||||
to track stack overrun.
|
||||
*/
|
||||
DBUG_ASSERT(this->thread_stack);
|
||||
DBUG_ASSERT(thread_stack);
|
||||
|
||||
if (my_pthread_setspecific_ptr(THR_THD, this) ||
|
||||
my_pthread_setspecific_ptr(THR_MALLOC, &mem_root))
|
||||
return 1;
|
||||
mysys_var=my_thread_var;
|
||||
dbug_thread_id=my_thread_id();
|
||||
/*
|
||||
By default 'slave_proxy_id' is 'thread_id'. They may later become different
|
||||
if this is the slave SQL thread.
|
||||
Let mysqld define the thread id (not mysys)
|
||||
This allows us to move THD to different threads if needed.
|
||||
*/
|
||||
variables.pseudo_thread_id= thread_id;
|
||||
mysys_var->id= thread_id;
|
||||
real_id= pthread_self(); // For debugging
|
||||
|
||||
/*
|
||||
We have to call thr_lock_info_init() again here as THD may have been
|
||||
created in another thread
|
||||
@ -2511,7 +2512,7 @@ my_size_t THD::pack_row(TABLE *table, MY_BITMAP const* cols, byte *row_data,
|
||||
if (bitmap_is_set(cols,i))
|
||||
{
|
||||
my_ptrdiff_t const offset=
|
||||
field->is_null(rec_offset) ? def_offset : rec_offset;
|
||||
field->is_null((uint) rec_offset) ? def_offset : rec_offset;
|
||||
field->move_field_offset(offset);
|
||||
ptr= (byte*)field->pack((char *) ptr, field->ptr);
|
||||
field->move_field_offset(-offset);
|
||||
|
Reference in New Issue
Block a user