diff options
author | unknown <heikki@donna.mysql.fi> | 2001-08-29 19:42:23 +0300 |
---|---|---|
committer | unknown <heikki@donna.mysql.fi> | 2001-08-29 19:42:23 +0300 |
commit | dd9fa926b390d59a13f4d2a8e2fef6d653372651 (patch) | |
tree | 9d78d40bd578ed463aac576cc0fbd077bbe9cd20 /innobase/include | |
parent | fc6696de0357612a35a968b824cbcd1819af4fa4 (diff) | |
download | mariadb-git-dd9fa926b390d59a13f4d2a8e2fef6d653372651.tar.gz |
trx0roll.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
trx0sys.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
trx0trx.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
row0mysql.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
row0purge.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
row0sel.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
row0uins.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
row0umod.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
row0upd.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
srv0srv.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
srv0start.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
sync0arr.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
fil0fil.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
ibuf0ibuf.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
lock0lock.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
os0file.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
btr0btr.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
btr0cur.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
btr0sea.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
buf0buf.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
data0data.c Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
srv0srv.h Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
trx0sys.h Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
trx0trx.h Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
btr0cur.h Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
buf0buf.h Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
data0data.h Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
ha_innobase.cc Fix the auto-inc+REPLACE+replication bug, improve InnoDB Monitor prints
sql/ha_innobase.cc:
Fix the auto-inc+REPLACE+replication bug, improve InnoDB Monitor prints
innobase/include/btr0cur.h:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/include/buf0buf.h:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/include/data0data.h:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/include/srv0srv.h:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/include/trx0sys.h:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/include/trx0trx.h:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/btr/btr0btr.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/btr/btr0cur.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/btr/btr0sea.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/buf/buf0buf.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/data/data0data.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/fil/fil0fil.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/ibuf/ibuf0ibuf.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/lock/lock0lock.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/os/os0file.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/row/row0mysql.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/row/row0purge.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/row/row0sel.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/row/row0uins.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/row/row0umod.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/row/row0upd.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/srv/srv0srv.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/srv/srv0start.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/sync/sync0arr.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/trx/trx0roll.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/trx/trx0sys.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
innobase/trx/trx0trx.c:
Fix the primary key update + BLOB bug, improve InnoDB Monitor prints
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/btr0cur.h | 70 | ||||
-rw-r--r-- | innobase/include/buf0buf.h | 11 | ||||
-rw-r--r-- | innobase/include/data0data.h | 7 | ||||
-rw-r--r-- | innobase/include/srv0srv.h | 16 | ||||
-rw-r--r-- | innobase/include/trx0sys.h | 3 | ||||
-rw-r--r-- | innobase/include/trx0trx.h | 24 |
6 files changed, 127 insertions, 4 deletions
diff --git a/innobase/include/btr0cur.h b/innobase/include/btr0cur.h index ffae434a5d9..f56a5662253 100644 --- a/innobase/include/btr0cur.h +++ b/innobase/include/btr0cur.h @@ -353,6 +353,7 @@ btr_cur_pessimistic_delete( if compression does not occur, the cursor stays valid: it points to successor of deleted record on function exit */ + ibool in_rollback,/* in: TRUE if called in rollback */ mtr_t* mtr); /* in: mtr */ /*************************************************************** Parses a redo log record of updating a record in-place. */ @@ -418,6 +419,52 @@ btr_estimate_number_of_different_key_vals( /* out: estimated number of key values */ dict_index_t* index); /* in: index */ /*********************************************************************** +Marks not updated extern fields as not-owned by this record. The ownership +is transferred to the updated record which is inserted elsewhere in the +index tree. In purge only the owner of externally stored field is allowed +to free the field. */ + +void +btr_cur_mark_extern_inherited_fields( +/*=================================*/ + rec_t* rec, /* in: record in a clustered index */ + upd_t* update, /* in: update vector */ + mtr_t* mtr); /* in: mtr */ +/*********************************************************************** +The complement of the previous function: in an update entry may inherit +some externally stored fields from a record. We must mark them as inherited +in entry, so that they are not freed in a rollback. */ + +void +btr_cur_mark_dtuple_inherited_extern( +/*=================================*/ + dtuple_t* entry, /* in: updated entry to be inserted to + clustered index */ + ulint* ext_vec, /* in: array of extern fields in the + original record */ + ulint n_ext_vec, /* in: number of elements in ext_vec */ + upd_t* update); /* in: update vector */ +/*********************************************************************** +Marks all extern fields in a record as owned by the record. This function +should be called if the delete mark of a record is removed: a not delete +marked record always owns all its extern fields. */ + +void +btr_cur_unmark_extern_fields( +/*=========================*/ + rec_t* rec, /* in: record in a clustered index */ + mtr_t* mtr); /* in: mtr */ +/*********************************************************************** +Marks all extern fields in a dtuple as owned by the record. */ + +void +btr_cur_unmark_dtuple_extern_fields( +/*================================*/ + dtuple_t* entry, /* in: clustered index entry */ + ulint* ext_vec, /* in: array of numbers of fields + which have been stored externally */ + ulint n_ext_vec); /* in: number of elements in ext_vec */ +/*********************************************************************** Stores the fields in big_rec_vec to the tablespace and puts pointers to them in rec. The fields are stored on pages allocated from leaf node file segment of the index tree. */ @@ -435,7 +482,9 @@ btr_store_big_rec_extern_fields( rec and to the tree */ /*********************************************************************** Frees the space in an externally stored field to the file space -management. */ +management if the field in data is owned the externally stored field, +in a rollback we may have the additional condition that the field must +not be inherited. */ void btr_free_externally_stored_field( @@ -446,6 +495,9 @@ btr_free_externally_stored_field( + reference to the externally stored part */ ulint local_len, /* in: length of data */ + ibool do_not_free_inherited,/* in: TRUE if called in a + rollback and we do not want to free + inherited fields */ mtr_t* local_mtr); /* in: mtr containing the latch to data an an X-latch to the index tree */ @@ -458,6 +510,9 @@ btr_rec_free_externally_stored_fields( dict_index_t* index, /* in: index of the data, the index tree MUST be X-latched */ rec_t* rec, /* in: record */ + ibool do_not_free_inherited,/* in: TRUE if called in a + rollback and we do not want to free + inherited fields */ mtr_t* mtr); /* in: mini-transaction handle which contains an X-latch to record page and to the index tree */ @@ -620,10 +675,21 @@ and sleep this many microseconds in between */ on that page */ #define BTR_EXTERN_LEN 12 /* 8 bytes containing the length of the externally - stored part of the BLOB */ + stored part of the BLOB. + The 2 highest bits are + reserved to the flags below. */ /*--------------------------------------*/ #define BTR_EXTERN_FIELD_REF_SIZE 20 +/* The highest bit of BTR_EXTERN_LEN (i.e., the highest bit of the byte +at lowest address) is set to 1 if this field does not 'own' the externally +stored field; only the owner field is allowed to free the field in purge! +If the 2nd highest bit is 1 then it means that the externally stored field +was inherited from an earlier version of the row. In rollback we are not +allowed to free an inherited external field. */ + +#define BTR_EXTERN_OWNER_FLAG 128 +#define BTR_EXTERN_INHERITED_FLAG 64 extern ulint btr_cur_n_non_sea; diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index 8b22561adf8..66071030402 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -771,6 +771,17 @@ struct buf_pool_struct{ ulint n_pages_written;/* number write operations */ ulint n_pages_created;/* number of pages created in the pool with no read */ + ulint n_page_gets; /* number of page gets performed; + also successful seraches through + the adaptive hash index are + counted as page gets; this field + is NOT protected by the buffer + pool mutex */ + ulint n_page_gets_old;/* n_page_gets when buf_print was + last time called: used to calculate + hit rate */ + ulint n_pages_read_old;/* n_pages_read when buf_print was + last time called */ /* 2. Page flushing algorithm fields */ UT_LIST_BASE_NODE_T(buf_block_t) flush_list; diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h index f695e0989a5..c314281d758 100644 --- a/innobase/include/data0data.h +++ b/innobase/include/data0data.h @@ -329,7 +329,12 @@ dtuple_convert_big_rec( the entry enough, i.e., if there are too many short fields in entry */ dict_index_t* index, /* in: index */ - dtuple_t* entry); /* in: index entry */ + dtuple_t* entry, /* in: index entry */ + ulint* ext_vec,/* in: array of externally stored fields, + or NULL: if a field already is externally + stored, then we cannot move it to the vector + this function returns */ + ulint n_ext_vec);/* in: number of elements is ext_vec */ /****************************************************************** Puts back to entry the data stored in vector. Note that to ensure the fields in entry can accommodate the data, vector must have been created diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index e635964e5ec..3f014adb76c 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -62,7 +62,15 @@ extern int srv_query_thread_priority; /*-------------------------------------------*/ +extern ulint srv_n_rows_inserted; +extern ulint srv_n_rows_updated; +extern ulint srv_n_rows_deleted; +extern ulint srv_n_rows_read; + extern ibool srv_print_innodb_monitor; +extern ibool srv_print_innodb_lock_monitor; +extern ibool srv_print_innodb_tablespace_monitor; + extern ulint srv_n_spin_wait_rounds; extern ulint srv_spin_wait_delay; extern ibool srv_priority_boost; @@ -105,13 +113,19 @@ extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, it from dynamic memory to get it to the same DRAM page as other hotspot semaphores */ #define kernel_mutex (*kernel_mutex_temp) + +#define SRV_MAX_N_IO_THREADS 100 +/* Array of English strings describing the current state of an +i/o handler thread */ +extern char* srv_io_thread_op_info[]; + typedef struct srv_sys_struct srv_sys_t; /* The server system */ extern srv_sys_t* srv_sys; -/* Alternatives for fiel flush option in Unix; see the InnoDB manual about +/* Alternatives for the field flush option in Unix; see the InnoDB manual about what these mean */ #define SRV_UNIX_FDATASYNC 1 #define SRV_UNIX_O_DSYNC 2 diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h index e26f7e19850..0295cd6abff 100644 --- a/innobase/include/trx0sys.h +++ b/innobase/include/trx0sys.h @@ -315,6 +315,9 @@ struct trx_sys_struct{ /* List of active and committed in memory transactions, sorted on trx id, biggest first */ + UT_LIST_BASE_NODE_T(trx_t) mysql_trx_list; + /* List of transactions created + for MySQL */ UT_LIST_BASE_NODE_T(trx_rseg_t) rseg_list; /* List of rollback segment objects */ trx_rseg_t* latest_rseg; /* Latest rollback segment in the diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index f67ba43162d..fdef041e929 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -130,6 +130,14 @@ void trx_mark_sql_stat_end( /*==================*/ trx_t* trx); /* in: trx handle */ +/************************************************************************** +Marks the latest SQL statement ended but does not start a new transaction +if the trx is not started. */ + +void +trx_mark_sql_stat_end_do_not_start_new( +/*===================================*/ + trx_t* trx); /* in: trx handle */ /************************************************************************ Assigns a read view for a consistent read query. All the consistent reads within the same transaction will get the same read view, which is created @@ -236,6 +244,14 @@ trx_commit_step( /*============*/ /* out: query thread to run next, or NULL */ que_thr_t* thr); /* in: query thread */ +/************************************************************************** +Prints info about a transaction to the standard output. The caller must +own the kernel mutex. */ + +void +trx_print( +/*======*/ + trx_t* trx); /* in: transaction */ /* Signal to a transaction */ @@ -270,6 +286,9 @@ rolling back after a database recovery */ struct trx_struct{ /* All the next fields are protected by the kernel mutex, except the undo logs which are protected by undo_mutex */ + char* op_info; /* English text describing the + current operation, or an empty + string */ ulint type; /* TRX_USER, TRX_PURGE */ ulint conc_state; /* state of the trx from the point of view of concurrency control: @@ -284,6 +303,8 @@ struct trx_struct{ table */ dulint table_id; /* table id if the preceding field is TRUE */ + void* mysql_thd; /* MySQL thread handle corresponding + to this trx, or NULL */ os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated with this transaction object */ ulint n_mysql_tables_in_use; /* number of Innobase tables @@ -302,6 +323,9 @@ struct trx_struct{ of a duplicate key error */ UT_LIST_NODE_T(trx_t) trx_list; /* list of transactions */ + UT_LIST_NODE_T(trx_t) + mysql_trx_list; /* list of transactions created for + MySQL */ /*------------------------------*/ mutex_t undo_mutex; /* mutex protecting the fields in this section (down to undo_no_arr), EXCEPT |