summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authoraivanov@mysql.com <>2006-03-29 23:04:32 +0400
committeraivanov@mysql.com <>2006-03-29 23:04:32 +0400
commit99d178033a195450f32f36662029adc4fd6a26bd (patch)
tree78b7b5f8fe975f9280333421e9b343ff4cf20588 /sql/ha_innodb.cc
parentfc86e304cc98e476138e097210dc65c34d417d83 (diff)
downloadmariadb-git-99d178033a195450f32f36662029adc4fd6a26bd.tar.gz
Applied innodb-5.0-ss368 snapshot
Fixed bugs: #16814: SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR section dict_foreign_key_error_report(): Always print a newline after invoking dict_print_info_on_foreign_key_in_create_format(). #16827: Better InnoDB error message if ibdata files omitted from my.cnf. #17126: CHECK TABLE on InnoDB causes a short hang during check of adaptive hash. CHECK TABLE blocking other queries, by releasing the btr_search_latch periodically during the adaptive hash table validation. #17405: Valgrind: conditional jump or move depends on uninitialised valuesw. buf_block_init(): Reset magic_n, buf_fix_count, and io_fix to avoid testing uninitialised variables. #18077: InnoDB uses full explicit table locks in stored FUNCTION. #18238: When locks exhaust the buffer pool, InnoDB does not roll back the trx. Check in pessimistic insert and update if the buffer pool is exhausted by locks. #18252: Disk space leaks in updates of InnoDB BLOB rows. btr_cur_pessimistic_update(): Invoke rec_get_offset() after rec_set_field_extern_bits(). btr_store_big_rec_extern_fields(): Note that offsets will no longer be valid after calling this function. #18283: When InnoDB returns error 'lock table full', MySQL can write to binlog too much. #18384: InnoDB memory leak on duplicate key errors if row has many columns. row_ins_duplicate_error_in_clust(): Call mem_heap_free(heap) at func_exit if needed. #18350: Use consistent read in CREATE ... SELECT .. if innodb_locks_unsafe_for_binlog is used.
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc88
1 files changed, 48 insertions, 40 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index f656e412e75..4b25f639a8f 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -513,13 +513,13 @@ convert_error_code_to_mysql(
return(HA_ERR_NO_SAVEPOINT);
} else if (error == (int) DB_LOCK_TABLE_FULL) {
- /* Since we rolled back the whole transaction, we must
- tell it also to MySQL so that MySQL knows to empty the
- cached binlog for this transaction */
+ /* Since we rolled back the whole transaction, we must
+ tell it also to MySQL so that MySQL knows to empty the
+ cached binlog for this transaction */
- if (thd) {
- ha_rollback(thd);
- }
+ if (thd) {
+ ha_rollback(thd);
+ }
return(HA_ERR_LOCK_TABLE_FULL);
} else {
@@ -6726,32 +6726,37 @@ static mysql_byte* innobase_get_key(INNOBASE_SHARE *share,uint *length,
static INNOBASE_SHARE *get_share(const char *table_name)
{
- INNOBASE_SHARE *share;
- pthread_mutex_lock(&innobase_share_mutex);
- uint length=(uint) strlen(table_name);
- if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables,
- (mysql_byte*) table_name,
- length)))
- {
- if ((share=(INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
- MYF(MY_WME | MY_ZEROFILL))))
- {
- share->table_name_length=length;
- share->table_name=(char*) (share+1);
- strmov(share->table_name,table_name);
- if (my_hash_insert(&innobase_open_tables, (mysql_byte*) share))
- {
- pthread_mutex_unlock(&innobase_share_mutex);
- my_free((gptr) share,0);
- return 0;
- }
- thr_lock_init(&share->lock);
- pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
- }
- }
- share->use_count++;
- pthread_mutex_unlock(&innobase_share_mutex);
- return share;
+ INNOBASE_SHARE *share;
+ pthread_mutex_lock(&innobase_share_mutex);
+ uint length=(uint) strlen(table_name);
+
+ if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables,
+ (mysql_byte*) table_name,
+ length))) {
+
+ share = (INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
+ MYF(MY_FAE | MY_ZEROFILL));
+
+ share->table_name_length=length;
+ share->table_name=(char*) (share+1);
+ strmov(share->table_name,table_name);
+
+ if (my_hash_insert(&innobase_open_tables,
+ (mysql_byte*) share)) {
+ pthread_mutex_unlock(&innobase_share_mutex);
+ my_free((gptr) share,0);
+
+ return 0;
+ }
+
+ thr_lock_init(&share->lock);
+ pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
+ }
+
+ share->use_count++;
+ pthread_mutex_unlock(&innobase_share_mutex);
+
+ return share;
}
static void free_share(INNOBASE_SHARE *share)
@@ -6825,14 +6830,16 @@ ha_innobase::store_lock(
prebuilt->trx->isolation_level != TRX_ISO_SERIALIZABLE &&
(lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) &&
(thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
- thd->lex->sql_command == SQLCOM_UPDATE)) {
+ thd->lex->sql_command == SQLCOM_UPDATE ||
+ thd->lex->sql_command == SQLCOM_CREATE_TABLE)) {
/* In case we have innobase_locks_unsafe_for_binlog
option set and isolation level of the transaction
is not set to serializable and MySQL is doing
- INSERT INTO...SELECT or UPDATE ... = (SELECT ...)
- without FOR UPDATE or IN SHARE MODE in select, then
- we use consistent read for select. */
+ INSERT INTO...SELECT or UPDATE ... = (SELECT ...) or
+ CREATE ... SELECT... without FOR UPDATE or
+ IN SHARE MODE in select, then we use consistent
+ read for select. */
prebuilt->select_lock_type = LOCK_NONE;
prebuilt->stored_select_lock_type = LOCK_NONE;
@@ -6885,14 +6892,15 @@ ha_innobase::store_lock(
writers. Note that ALTER TABLE uses a TL_WRITE_ALLOW_READ
< TL_WRITE_CONCURRENT_INSERT.
- We especially allow multiple writers if MySQL is at the
- start of a stored procedure call (SQLCOM_CALL)
- (MySQL does have thd->in_lock_tables TRUE there). */
+ We especially allow multiple writers if MySQL is at the
+ start of a stored procedure call (SQLCOM_CALL) or a
+ stored function call (MySQL does have thd->in_lock_tables
+ TRUE there). */
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
&& lock_type <= TL_WRITE)
&& !(thd->in_lock_tables
- && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
+ && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
&& !thd->tablespace_op
&& thd->lex->sql_command != SQLCOM_TRUNCATE
&& thd->lex->sql_command != SQLCOM_OPTIMIZE