Loading include/my_sys.h +67 −66 Original line number Diff line number Diff line Loading @@ -302,30 +302,38 @@ typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); typedef struct st_io_cache /* Used when cacheing files */ { /* pos_in_file is offset in file corresponding to the first byte of byte* buffer. end_of_file is the offset of end of file for READ_CACHE and WRITE_CACHE. For SEQ_READ_APPEND it the maximum of the actual end of file and the position represented by read_end. */ my_off_t pos_in_file,end_of_file; /* read_pos points to current read position in the buffer read_end is the non-inclusive boundary in the buffer for the currently valid read area buffer is the read buffer not sure about request_pos except that it is used in async_io /* Offset in file corresponding to the first byte of byte* buffer. */ my_off_t pos_in_file; /* The offset of end of file for READ_CACHE and WRITE_CACHE. For SEQ_READ_APPEND it the maximum of the actual end of file and the position represented by read_end. */ byte *read_pos,*read_end,*buffer,*request_pos; /* write_buffer is used only in WRITE caches and in SEQ_READ_APPEND to buffer writes append_read_pos is only used in SEQ_READ_APPEND, and points to the current read position in the write buffer. Note that reads in SEQ_READ_APPEND caches can happen from both read buffer (byte* buffer), and write buffer (byte* write_buffer). write_pos points to current write position in the write buffer and write_end is the non-inclusive boundary of the valid write area my_off_t end_of_file; /* Points to current read position in the buffer */ byte *read_pos; /* the non-inclusive boundary in the buffer for the currently valid read */ byte *read_end; byte *buffer; /* The read buffer */ /* Used in ASYNC_IO */ byte *request_pos; /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */ byte *write_buffer; /* Only used in SEQ_READ_APPEND, and points to the current read position in the write buffer. Note that reads in SEQ_READ_APPEND caches can happen from both read buffer (byte* buffer) and write buffer (byte* write_buffer). */ byte *write_buffer, *append_read_pos, *write_pos, *write_end; /* current_pos and current_end are convenience variables used by byte *append_read_pos; /* Points to current write position in the write buffer */ byte *write_pos; /* The non-inclusive boundary of the valid write area */ byte *write_end; /* Current_pos and current_end are convenience variables used by my_b_tell() and other routines that need to know the current offset current_pos points to &write_pos, and current_end to &write_end in a WRITE_CACHE, and &read_pos and &read_end respectively otherwise Loading @@ -336,24 +344,28 @@ typedef struct st_io_cache /* Used when cacheing files */ pthread_mutex_t append_buffer_lock; /* need mutex copying from append buffer to read buffer */ #endif /* a caller will use my_b_read() macro to read from the cache /* A caller will use my_b_read() macro to read from the cache if the data is already in cache, it will be simply copied with memcpy() and internal variables will be accordinging updated with no functions invoked. However, if the data is not fully in the cache, my_b_read() will call read_function to fetch the data. read_function must never be invoked directly must never be invoked directly. */ int (*read_function)(struct st_io_cache *,byte *,uint); /* same idea as in the case of read_function, except my_b_write() needs to /* Same idea as in the case of read_function, except my_b_write() needs to be replaced with my_b_append() for a SEQ_READ_APPEND cache */ int (*write_function)(struct st_io_cache *,const byte *,uint); /* specifies the type of the cache. Depending on the type of the cache /* Specifies the type of the cache. Depending on the type of the cache certain operations might not be available and yield unpredicatable results. Details to be documented later */ enum cache_type type; /* callbacks when the actual read I/O happens. These were added and /* Callbacks when the actual read I/O happens. These were added and are currently used for binary logging of LOAD DATA INFILE - when a block is read from the file, we create a block create/append event, and when IO_CACHE is closed, we create an end event. These functions could, Loading @@ -366,40 +378,30 @@ typedef struct st_io_cache /* Used when cacheing files */ char *file_name; /* if used with 'open_cached_file' */ char *dir,*prefix; File file; /* file descriptor */ /* seek_not_done is set by my_b_seek() to inform the upcoming read/write /* seek_not_done is set by my_b_seek() to inform the upcoming read/write operation that a seek needs to be preformed prior to the actual I/O error is 0 if the cache operation was successful, -1 if there was a "hard" error, and the actual number of I/O-ed bytes if the read/write was partial partial. */ int seek_not_done,error; /* buffer_length is the size of memory allocated for buffer or write_buffer read_length is the same as buffer_length except when we use async io not sure why we need it */ uint buffer_length,read_length; /* buffer_length is memory size allocated for buffer or write_buffer */ uint buffer_length; /* read_length is the same as buffer_length except when we use async io */ uint read_length; myf myflags; /* Flags used to my_read/my_write */ /* alloced_buffer is 1 if the buffer was allocated by init_io_cache() and 0 if it was supplied by the user 0 if it was supplied by the user. Currently READ_NET is the only one that will use a buffer allocated somewhere else */ my_bool alloced_buffer; /* init_count is incremented every time we call init_io_cache() It is not reset in end_io_cache(). This variable was introduced for slave relay logs - RELAY_LOG_INFO stores a pointer to IO_CACHE that could in some cases refer to the IO_CACHE of the currently active relay log. The IO_CACHE then could be closed, re-opened and start pointing to a different log file. In that case, we could not know reliably if this happened without init_count one must be careful with bzero() prior to the subsequent init_io_cache() call */ int init_count; #ifdef HAVE_AIOWAIT /* as inidicated by ifdef, this is for async I/O, we will have Sinisa comment this some time /* As inidicated by ifdef, this is for async I/O, which is not currently used (because it's not reliable on all systems) */ uint inited; my_off_t aio_read_pos; Loading Loading @@ -428,7 +430,6 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); ((info)->write_pos+=(Count)),0) : \ (*(info)->write_function)((info),(Buffer),(Count))) #define my_b_get(info) \ ((info)->read_pos != (info)->read_end ?\ ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\ Loading innobase/srv/srv0srv.c +7 −7 Original line number Diff line number Diff line Loading @@ -1631,6 +1631,7 @@ srv_init(void) for (i = 0; i < OS_THREAD_MAX_N; i++) { slot = srv_table_get_nth_slot(i); slot->in_use = FALSE; slot->type=0; /* Avoid purify errors */ slot->event = os_event_create(NULL); ut_a(slot->event); } Loading Loading @@ -1899,7 +1900,6 @@ srv_conc_exit_innodb( trx_t* trx) /* in: transaction object associated with the thread */ { srv_conc_slot_t* slot = NULL; if (srv_thread_concurrency >= 500) { Loading Loading @@ -2514,11 +2514,11 @@ srv_master_thread( can drop tables lazily after there no longer are SELECT queries to them. */ srv_main_thread_op_info = "doing background drop tables"; srv_main_thread_op_info = (char*) "doing background drop tables"; row_drop_tables_for_mysql_in_background(); srv_main_thread_op_info = ""; srv_main_thread_op_info = (char*) ""; if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) { Loading Loading @@ -2630,19 +2630,19 @@ srv_master_thread( /* In this loop we run background operations when the server is quiet and we also come here about once in 10 seconds */ srv_main_thread_op_info = "doing background drop tables"; srv_main_thread_op_info = (char*) "doing background drop tables"; n_tables_to_drop = row_drop_tables_for_mysql_in_background(); srv_main_thread_op_info = ""; srv_main_thread_op_info = (char*) ""; srv_main_thread_op_info = "flushing buffer pool pages"; srv_main_thread_op_info = (char*) "flushing buffer pool pages"; /* Flush a few oldest pages to make the checkpoint younger */ n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 10, ut_dulint_max); srv_main_thread_op_info = "making checkpoint"; srv_main_thread_op_info = (char*) "making checkpoint"; /* Make a new checkpoint about once in 10 seconds */ Loading mysql-test/mysql-test-run.sh +15 −5 Original line number Diff line number Diff line Loading @@ -887,13 +887,23 @@ start_slave() "gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD elif [ x$DO_GDB = x1 ] then $ECHO "set args $slave_args" > $GDB_SLAVE_INIT if [ x$MANUAL_GDB = x1 ] then $ECHO "set args $slave_args" > $GDB_SLAVE_INIT echo "To start gdb for the slave, type in another window:" echo "cd $CWD ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD" wait_for_slave=1500 else ( $ECHO set args $slave_args; if [ $USE_MANAGER = 0 ] ; then cat <<EOF b mysql_parse commands 1 disa 1 end r EOF fi ) > $GDB_SLAVE_INIT manager_launch $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \ gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD fi Loading mysys/mf_iocache.c +0 −2 Original line number Diff line number Diff line Loading @@ -122,8 +122,6 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, info->pos_in_file= seek_offset; info->pre_close = info->pre_read = info->post_read = 0; info->arg = 0; info->init_count++; /* we assume the user had set it to 0 prior to first call */ info->alloced_buffer = 0; info->buffer=0; info->seek_not_done= test(file >= 0); Loading sql/field.cc +2 −1 Original line number Diff line number Diff line Loading @@ -4628,7 +4628,7 @@ bool Field_num::eq_def(Field *field) *****************************************************************************/ /* ** Make a field from the .frm file info Make a field from the .frm file info */ uint32 calc_pack_length(enum_field_types type,uint32 length) Loading Loading @@ -4657,6 +4657,7 @@ uint32 calc_pack_length(enum_field_types type,uint32 length) case FIELD_TYPE_LONG_BLOB: return 4+portable_sizeof_char_ptr; case FIELD_TYPE_SET: case FIELD_TYPE_ENUM: abort(); return 0; // This shouldn't happen default: return 0; } return 0; // This shouldn't happen } Loading Loading
include/my_sys.h +67 −66 Original line number Diff line number Diff line Loading @@ -302,30 +302,38 @@ typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); typedef struct st_io_cache /* Used when cacheing files */ { /* pos_in_file is offset in file corresponding to the first byte of byte* buffer. end_of_file is the offset of end of file for READ_CACHE and WRITE_CACHE. For SEQ_READ_APPEND it the maximum of the actual end of file and the position represented by read_end. */ my_off_t pos_in_file,end_of_file; /* read_pos points to current read position in the buffer read_end is the non-inclusive boundary in the buffer for the currently valid read area buffer is the read buffer not sure about request_pos except that it is used in async_io /* Offset in file corresponding to the first byte of byte* buffer. */ my_off_t pos_in_file; /* The offset of end of file for READ_CACHE and WRITE_CACHE. For SEQ_READ_APPEND it the maximum of the actual end of file and the position represented by read_end. */ byte *read_pos,*read_end,*buffer,*request_pos; /* write_buffer is used only in WRITE caches and in SEQ_READ_APPEND to buffer writes append_read_pos is only used in SEQ_READ_APPEND, and points to the current read position in the write buffer. Note that reads in SEQ_READ_APPEND caches can happen from both read buffer (byte* buffer), and write buffer (byte* write_buffer). write_pos points to current write position in the write buffer and write_end is the non-inclusive boundary of the valid write area my_off_t end_of_file; /* Points to current read position in the buffer */ byte *read_pos; /* the non-inclusive boundary in the buffer for the currently valid read */ byte *read_end; byte *buffer; /* The read buffer */ /* Used in ASYNC_IO */ byte *request_pos; /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */ byte *write_buffer; /* Only used in SEQ_READ_APPEND, and points to the current read position in the write buffer. Note that reads in SEQ_READ_APPEND caches can happen from both read buffer (byte* buffer) and write buffer (byte* write_buffer). */ byte *write_buffer, *append_read_pos, *write_pos, *write_end; /* current_pos and current_end are convenience variables used by byte *append_read_pos; /* Points to current write position in the write buffer */ byte *write_pos; /* The non-inclusive boundary of the valid write area */ byte *write_end; /* Current_pos and current_end are convenience variables used by my_b_tell() and other routines that need to know the current offset current_pos points to &write_pos, and current_end to &write_end in a WRITE_CACHE, and &read_pos and &read_end respectively otherwise Loading @@ -336,24 +344,28 @@ typedef struct st_io_cache /* Used when cacheing files */ pthread_mutex_t append_buffer_lock; /* need mutex copying from append buffer to read buffer */ #endif /* a caller will use my_b_read() macro to read from the cache /* A caller will use my_b_read() macro to read from the cache if the data is already in cache, it will be simply copied with memcpy() and internal variables will be accordinging updated with no functions invoked. However, if the data is not fully in the cache, my_b_read() will call read_function to fetch the data. read_function must never be invoked directly must never be invoked directly. */ int (*read_function)(struct st_io_cache *,byte *,uint); /* same idea as in the case of read_function, except my_b_write() needs to /* Same idea as in the case of read_function, except my_b_write() needs to be replaced with my_b_append() for a SEQ_READ_APPEND cache */ int (*write_function)(struct st_io_cache *,const byte *,uint); /* specifies the type of the cache. Depending on the type of the cache /* Specifies the type of the cache. Depending on the type of the cache certain operations might not be available and yield unpredicatable results. Details to be documented later */ enum cache_type type; /* callbacks when the actual read I/O happens. These were added and /* Callbacks when the actual read I/O happens. These were added and are currently used for binary logging of LOAD DATA INFILE - when a block is read from the file, we create a block create/append event, and when IO_CACHE is closed, we create an end event. These functions could, Loading @@ -366,40 +378,30 @@ typedef struct st_io_cache /* Used when cacheing files */ char *file_name; /* if used with 'open_cached_file' */ char *dir,*prefix; File file; /* file descriptor */ /* seek_not_done is set by my_b_seek() to inform the upcoming read/write /* seek_not_done is set by my_b_seek() to inform the upcoming read/write operation that a seek needs to be preformed prior to the actual I/O error is 0 if the cache operation was successful, -1 if there was a "hard" error, and the actual number of I/O-ed bytes if the read/write was partial partial. */ int seek_not_done,error; /* buffer_length is the size of memory allocated for buffer or write_buffer read_length is the same as buffer_length except when we use async io not sure why we need it */ uint buffer_length,read_length; /* buffer_length is memory size allocated for buffer or write_buffer */ uint buffer_length; /* read_length is the same as buffer_length except when we use async io */ uint read_length; myf myflags; /* Flags used to my_read/my_write */ /* alloced_buffer is 1 if the buffer was allocated by init_io_cache() and 0 if it was supplied by the user 0 if it was supplied by the user. Currently READ_NET is the only one that will use a buffer allocated somewhere else */ my_bool alloced_buffer; /* init_count is incremented every time we call init_io_cache() It is not reset in end_io_cache(). This variable was introduced for slave relay logs - RELAY_LOG_INFO stores a pointer to IO_CACHE that could in some cases refer to the IO_CACHE of the currently active relay log. The IO_CACHE then could be closed, re-opened and start pointing to a different log file. In that case, we could not know reliably if this happened without init_count one must be careful with bzero() prior to the subsequent init_io_cache() call */ int init_count; #ifdef HAVE_AIOWAIT /* as inidicated by ifdef, this is for async I/O, we will have Sinisa comment this some time /* As inidicated by ifdef, this is for async I/O, which is not currently used (because it's not reliable on all systems) */ uint inited; my_off_t aio_read_pos; Loading Loading @@ -428,7 +430,6 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); ((info)->write_pos+=(Count)),0) : \ (*(info)->write_function)((info),(Buffer),(Count))) #define my_b_get(info) \ ((info)->read_pos != (info)->read_end ?\ ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\ Loading
innobase/srv/srv0srv.c +7 −7 Original line number Diff line number Diff line Loading @@ -1631,6 +1631,7 @@ srv_init(void) for (i = 0; i < OS_THREAD_MAX_N; i++) { slot = srv_table_get_nth_slot(i); slot->in_use = FALSE; slot->type=0; /* Avoid purify errors */ slot->event = os_event_create(NULL); ut_a(slot->event); } Loading Loading @@ -1899,7 +1900,6 @@ srv_conc_exit_innodb( trx_t* trx) /* in: transaction object associated with the thread */ { srv_conc_slot_t* slot = NULL; if (srv_thread_concurrency >= 500) { Loading Loading @@ -2514,11 +2514,11 @@ srv_master_thread( can drop tables lazily after there no longer are SELECT queries to them. */ srv_main_thread_op_info = "doing background drop tables"; srv_main_thread_op_info = (char*) "doing background drop tables"; row_drop_tables_for_mysql_in_background(); srv_main_thread_op_info = ""; srv_main_thread_op_info = (char*) ""; if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) { Loading Loading @@ -2630,19 +2630,19 @@ srv_master_thread( /* In this loop we run background operations when the server is quiet and we also come here about once in 10 seconds */ srv_main_thread_op_info = "doing background drop tables"; srv_main_thread_op_info = (char*) "doing background drop tables"; n_tables_to_drop = row_drop_tables_for_mysql_in_background(); srv_main_thread_op_info = ""; srv_main_thread_op_info = (char*) ""; srv_main_thread_op_info = "flushing buffer pool pages"; srv_main_thread_op_info = (char*) "flushing buffer pool pages"; /* Flush a few oldest pages to make the checkpoint younger */ n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 10, ut_dulint_max); srv_main_thread_op_info = "making checkpoint"; srv_main_thread_op_info = (char*) "making checkpoint"; /* Make a new checkpoint about once in 10 seconds */ Loading
mysql-test/mysql-test-run.sh +15 −5 Original line number Diff line number Diff line Loading @@ -887,13 +887,23 @@ start_slave() "gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD elif [ x$DO_GDB = x1 ] then $ECHO "set args $slave_args" > $GDB_SLAVE_INIT if [ x$MANUAL_GDB = x1 ] then $ECHO "set args $slave_args" > $GDB_SLAVE_INIT echo "To start gdb for the slave, type in another window:" echo "cd $CWD ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD" wait_for_slave=1500 else ( $ECHO set args $slave_args; if [ $USE_MANAGER = 0 ] ; then cat <<EOF b mysql_parse commands 1 disa 1 end r EOF fi ) > $GDB_SLAVE_INIT manager_launch $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \ gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD fi Loading
mysys/mf_iocache.c +0 −2 Original line number Diff line number Diff line Loading @@ -122,8 +122,6 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, info->pos_in_file= seek_offset; info->pre_close = info->pre_read = info->post_read = 0; info->arg = 0; info->init_count++; /* we assume the user had set it to 0 prior to first call */ info->alloced_buffer = 0; info->buffer=0; info->seek_not_done= test(file >= 0); Loading
sql/field.cc +2 −1 Original line number Diff line number Diff line Loading @@ -4628,7 +4628,7 @@ bool Field_num::eq_def(Field *field) *****************************************************************************/ /* ** Make a field from the .frm file info Make a field from the .frm file info */ uint32 calc_pack_length(enum_field_types type,uint32 length) Loading Loading @@ -4657,6 +4657,7 @@ uint32 calc_pack_length(enum_field_types type,uint32 length) case FIELD_TYPE_LONG_BLOB: return 4+portable_sizeof_char_ptr; case FIELD_TYPE_SET: case FIELD_TYPE_ENUM: abort(); return 0; // This shouldn't happen default: return 0; } return 0; // This shouldn't happen } Loading