diff options
author | marko@hundin.mysql.fi <> | 2005-06-21 07:36:18 +0300 |
---|---|---|
committer | marko@hundin.mysql.fi <> | 2005-06-21 07:36:18 +0300 |
commit | e992adcb3fd5d91bb10b63aab19c64ef433e7a36 (patch) | |
tree | 767c26a535c75a55034463ff090808d95891c741 /sql | |
parent | ff20e1c2ca810b104cb9389bf5066b85d014cffe (diff) | |
parent | f70798884cb3754b4e1eb269f0609a3fe95c2f3a (diff) | |
download | mariadb-git-e992adcb3fd5d91bb10b63aab19c64ef433e7a36.tar.gz |
Merge hundin.mysql.fi:/home/marko/mysql-5.0
into hundin.mysql.fi:/home/marko/mysql-5.0-current
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innodb.cc | 43 | ||||
-rw-r--r-- | sql/ha_innodb.h | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 |
3 files changed, 31 insertions, 16 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 92ec482a468..6dd07930244 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -146,8 +146,7 @@ long innobase_mirrored_log_groups, innobase_log_files_in_group, innobase_buffer_pool_awe_mem_mb, innobase_buffer_pool_size, innobase_additional_mem_pool_size, innobase_file_io_threads, innobase_lock_wait_timeout, - innobase_thread_concurrency, innobase_force_recovery, - innobase_open_files; + innobase_force_recovery, innobase_open_files; /* The default values for the following char* start-up parameters are determined in innobase_init below: */ @@ -327,7 +326,7 @@ innodb_srv_conc_enter_innodb( /*=========================*/ trx_t* trx) /* in: transaction handle */ { - if (srv_thread_concurrency >= 500) { + if (UNIV_LIKELY(srv_thread_concurrency >= 20)) { return; } @@ -344,7 +343,7 @@ innodb_srv_conc_exit_innodb( /*========================*/ trx_t* trx) /* in: transaction handle */ { - if (srv_thread_concurrency >= 500) { + if (UNIV_LIKELY(srv_thread_concurrency >= 20)) { return; } @@ -1045,6 +1044,18 @@ mysql_get_identifier_quote_char( } /************************************************************************** +Determines if the currently running transaction has been interrupted. */ +extern "C" +ibool +trx_is_interrupted( +/*===============*/ + /* out: TRUE if interrupted */ + trx_t* trx) /* in: transaction */ +{ + return(trx && trx->mysql_thd && ((THD*) trx->mysql_thd)->killed); +} + +/************************************************************************** Obtain a pointer to the MySQL THD object, as in current_thd(). This definition must match the one in sql/ha_innodb.cc! */ extern "C" @@ -1302,8 +1313,8 @@ innobase_init(void) data_mysql_default_charset_coll = (ulint)default_charset_info->number; - data_mysql_latin1_swedish_charset_coll = - (ulint)my_charset_latin1.number; + ut_a(DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL == + my_charset_latin1.number); /* Store the latin1_swedish_ci character ordering table to InnoDB. For non-latin1_swedish_ci charsets we use the MySQL comparison functions, @@ -2867,6 +2878,8 @@ build_template( ibool fetch_all_in_key = FALSE; ibool fetch_primary_key_cols = FALSE; ulint i; + /* byte offset of the end of last requested column */ + ulint mysql_prefix_len = 0; if (prebuilt->select_lock_type == LOCK_X) { /* We always retrieve the whole clustered index record if we @@ -2987,6 +3000,11 @@ build_template( get_field_offset(table, field); templ->mysql_col_len = (ulint) field->pack_length(); + if (mysql_prefix_len < templ->mysql_col_offset + + templ->mysql_col_len) { + mysql_prefix_len = templ->mysql_col_offset + + templ->mysql_col_len; + } templ->type = index->table->cols[i].type.mtype; templ->mysql_type = (ulint)field->type(); @@ -3009,6 +3027,7 @@ skip_field: } prebuilt->n_template = n_requested_fields; + prebuilt->mysql_prefix_len = mysql_prefix_len; if (index != clust_index && prebuilt->need_to_access_clustered) { /* Change rec_field_no's to correspond to the clustered index @@ -3080,7 +3099,7 @@ ha_innobase::write_row( being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */ dict_table_t* src_table; - ibool mode; + ulint mode; num_write_row = 0; @@ -5991,7 +6010,7 @@ ha_innobase::external_lock( ulint error; error = row_lock_table_for_mysql(prebuilt, - NULL, LOCK_TABLE_EXP); + NULL, 0); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql( @@ -6011,9 +6030,6 @@ ha_innobase::external_lock( trx->n_mysql_tables_in_use--; prebuilt->mysql_has_locked = FALSE; - if (trx->n_lock_table_exp) { - row_unlock_tables_for_mysql(trx); - } /* If the MySQL lock count drops to zero we know that the current SQL statement has ended */ @@ -6055,7 +6071,7 @@ user issued query LOCK TABLES..WHERE ENGINE = InnoDB. */ int ha_innobase::transactional_table_lock( /*==================================*/ - /* out: 0 */ + /* out: error code */ THD* thd, /* in: handle to the user thread */ int lock_type) /* in: lock type */ { @@ -6119,8 +6135,7 @@ ha_innobase::transactional_table_lock( if (thd->in_lock_tables && thd->variables.innodb_table_locks) { ulint error = DB_SUCCESS; - error = row_lock_table_for_mysql(prebuilt,NULL, - LOCK_TABLE_TRANSACTIONAL); + error = row_lock_table_for_mysql(prebuilt, NULL, 0); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql((int) error, user_thd); diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 4c0f5209af9..90cae3998ed 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -218,7 +218,7 @@ extern long innobase_log_file_size, innobase_log_buffer_size; extern long innobase_buffer_pool_size, innobase_additional_mem_pool_size; extern long innobase_buffer_pool_awe_mem_mb; extern long innobase_file_io_threads, innobase_lock_wait_timeout; -extern long innobase_force_recovery, innobase_thread_concurrency; +extern long innobase_force_recovery; extern long innobase_open_files; extern char *innobase_data_home_dir, *innobase_data_file_path; extern char *innobase_log_group_home_dir, *innobase_log_arch_dir; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9c44d218954..5e6df9b61e1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5238,7 +5238,7 @@ log and this option does nothing anymore.", {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY, "Helps in performance tuning in heavily concurrent environments.", (gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency, - 0, GET_LONG, REQUIRED_ARG, 8, 1, 1000, 0, 1, 0}, + 0, GET_LONG, REQUIRED_ARG, 20, 1, 1000, 0, 1, 0}, {"innodb_thread_sleep_delay", OPT_INNODB_THREAD_SLEEP_DELAY, "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0" " disable a sleep", |