Loading mysql-test/mysql-test-run.pl +1 −1 Original line number Diff line number Diff line Loading @@ -2905,7 +2905,7 @@ sub mysql_install_db () { install_db('master', $master->[0]->{'path_myddir'}); if ($max_master_num) if ($max_master_num > 1) { copy_install_db('master', $master->[1]->{'path_myddir'}); } Loading mysql-test/r/federated.result +14 −0 Original line number Diff line number Diff line Loading @@ -1920,6 +1920,20 @@ a b 2 Curly drop table federated.t1; drop table federated.t1; Bug#18287 create federated table always times out, error 1159 ' ' Test that self-references work create table federated.t1 (a int primary key); create table federated.t2 (a int primary key) ENGINE=FEDERATED connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; insert into federated.t1 (a) values (1); select * from federated.t2; a 1 drop table federated.t1, federated.t2; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; Loading mysql-test/t/federated.test +14 −0 Original line number Diff line number Diff line Loading @@ -1671,5 +1671,19 @@ drop table federated.t1; connection slave; drop table federated.t1; --echo --echo Bug#18287 create federated table always times out, error 1159 ' ' --echo --echo Test that self-references work --echo connection slave; create table federated.t1 (a int primary key); --replace_result $SLAVE_MYPORT SLAVE_PORT eval create table federated.t2 (a int primary key) ENGINE=FEDERATED connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; insert into federated.t1 (a) values (1); select * from federated.t2; drop table federated.t1, federated.t2; source include/federated_cleanup.inc; mysys/thr_lock.c +32 −8 Original line number Diff line number Diff line Loading @@ -383,6 +383,9 @@ static inline my_bool have_specific_lock(THR_LOCK_DATA *data, } static void wake_up_waiters(THR_LOCK *lock); static enum enum_thr_lock_result wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, my_bool in_wait_list) Loading Loading @@ -444,8 +447,13 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, else wait->last=data->prev; data->type= TL_UNLOCK; /* No lock */ check_locks(data->lock, "killed or timed out wait_for_lock", 1); wake_up_waiters(data->lock); } else { check_locks(data->lock, "aborted wait_for_lock", 0); } check_locks(data->lock,"failed wait_for_lock",0); } else { Loading Loading @@ -771,6 +779,26 @@ void thr_unlock(THR_LOCK_DATA *data) lock->read_no_write_count--; data->type=TL_UNLOCK; /* Mark unlocked */ check_locks(lock,"after releasing lock",1); wake_up_waiters(lock); pthread_mutex_unlock(&lock->mutex); DBUG_VOID_RETURN; } /** @brief Wake up all threads which pending requests for the lock can be satisfied. @param lock Lock for which threads should be woken up */ static void wake_up_waiters(THR_LOCK *lock) { THR_LOCK_DATA *data; enum thr_lock_type lock_type; DBUG_ENTER("wake_up_waiters"); if (!lock->write.data) /* If no active write locks */ { Loading Loading @@ -820,11 +848,7 @@ void thr_unlock(THR_LOCK_DATA *data) data=lock->write_wait.data; /* Free this too */ } if (data->type >= TL_WRITE_LOW_PRIORITY) { check_locks(lock,"giving write lock",0); pthread_mutex_unlock(&lock->mutex); DBUG_VOID_RETURN; } goto end; /* Release possible read locks together with the write lock */ } if (lock->read_wait.data) Loading Loading @@ -879,8 +903,7 @@ void thr_unlock(THR_LOCK_DATA *data) free_all_read_locks(lock,0); } end: check_locks(lock,"thr_unlock",0); pthread_mutex_unlock(&lock->mutex); check_locks(lock, "after waking up waiters", 0); DBUG_VOID_RETURN; } Loading Loading @@ -1094,6 +1117,7 @@ my_bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) lock->write_wait.last= data->prev; } } wake_up_waiters(lock); pthread_mutex_unlock(&lock->mutex); DBUG_RETURN(found); } Loading sql/item.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1670,7 +1670,7 @@ void Item_ident_for_show::make_field(Send_field *tmp_field) tmp_field->type=field->type(); tmp_field->flags= field->table->maybe_null ? (field->flags & ~NOT_NULL_FLAG) : field->flags; tmp_field->decimals= 0; tmp_field->decimals= field->decimals(); } /**********************************************/ Loading Loading
mysql-test/mysql-test-run.pl +1 −1 Original line number Diff line number Diff line Loading @@ -2905,7 +2905,7 @@ sub mysql_install_db () { install_db('master', $master->[0]->{'path_myddir'}); if ($max_master_num) if ($max_master_num > 1) { copy_install_db('master', $master->[1]->{'path_myddir'}); } Loading
mysql-test/r/federated.result +14 −0 Original line number Diff line number Diff line Loading @@ -1920,6 +1920,20 @@ a b 2 Curly drop table federated.t1; drop table federated.t1; Bug#18287 create federated table always times out, error 1159 ' ' Test that self-references work create table federated.t1 (a int primary key); create table federated.t2 (a int primary key) ENGINE=FEDERATED connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; insert into federated.t1 (a) values (1); select * from federated.t2; a 1 drop table federated.t1, federated.t2; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; Loading
mysql-test/t/federated.test +14 −0 Original line number Diff line number Diff line Loading @@ -1671,5 +1671,19 @@ drop table federated.t1; connection slave; drop table federated.t1; --echo --echo Bug#18287 create federated table always times out, error 1159 ' ' --echo --echo Test that self-references work --echo connection slave; create table federated.t1 (a int primary key); --replace_result $SLAVE_MYPORT SLAVE_PORT eval create table federated.t2 (a int primary key) ENGINE=FEDERATED connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; insert into federated.t1 (a) values (1); select * from federated.t2; drop table federated.t1, federated.t2; source include/federated_cleanup.inc;
mysys/thr_lock.c +32 −8 Original line number Diff line number Diff line Loading @@ -383,6 +383,9 @@ static inline my_bool have_specific_lock(THR_LOCK_DATA *data, } static void wake_up_waiters(THR_LOCK *lock); static enum enum_thr_lock_result wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, my_bool in_wait_list) Loading Loading @@ -444,8 +447,13 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, else wait->last=data->prev; data->type= TL_UNLOCK; /* No lock */ check_locks(data->lock, "killed or timed out wait_for_lock", 1); wake_up_waiters(data->lock); } else { check_locks(data->lock, "aborted wait_for_lock", 0); } check_locks(data->lock,"failed wait_for_lock",0); } else { Loading Loading @@ -771,6 +779,26 @@ void thr_unlock(THR_LOCK_DATA *data) lock->read_no_write_count--; data->type=TL_UNLOCK; /* Mark unlocked */ check_locks(lock,"after releasing lock",1); wake_up_waiters(lock); pthread_mutex_unlock(&lock->mutex); DBUG_VOID_RETURN; } /** @brief Wake up all threads which pending requests for the lock can be satisfied. @param lock Lock for which threads should be woken up */ static void wake_up_waiters(THR_LOCK *lock) { THR_LOCK_DATA *data; enum thr_lock_type lock_type; DBUG_ENTER("wake_up_waiters"); if (!lock->write.data) /* If no active write locks */ { Loading Loading @@ -820,11 +848,7 @@ void thr_unlock(THR_LOCK_DATA *data) data=lock->write_wait.data; /* Free this too */ } if (data->type >= TL_WRITE_LOW_PRIORITY) { check_locks(lock,"giving write lock",0); pthread_mutex_unlock(&lock->mutex); DBUG_VOID_RETURN; } goto end; /* Release possible read locks together with the write lock */ } if (lock->read_wait.data) Loading Loading @@ -879,8 +903,7 @@ void thr_unlock(THR_LOCK_DATA *data) free_all_read_locks(lock,0); } end: check_locks(lock,"thr_unlock",0); pthread_mutex_unlock(&lock->mutex); check_locks(lock, "after waking up waiters", 0); DBUG_VOID_RETURN; } Loading Loading @@ -1094,6 +1117,7 @@ my_bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) lock->write_wait.last= data->prev; } } wake_up_waiters(lock); pthread_mutex_unlock(&lock->mutex); DBUG_RETURN(found); } Loading
sql/item.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1670,7 +1670,7 @@ void Item_ident_for_show::make_field(Send_field *tmp_field) tmp_field->type=field->type(); tmp_field->flags= field->table->maybe_null ? (field->flags & ~NOT_NULL_FLAG) : field->flags; tmp_field->decimals= 0; tmp_field->decimals= field->decimals(); } /**********************************************/ Loading