diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.cc | 6 | ||||
-rw-r--r-- | sql/mysqld.cc | 19 | ||||
-rw-r--r-- | sql/sql_parse.cc | 3 | ||||
-rw-r--r-- | sql/sql_select.cc | 20 |
4 files changed, 35 insertions, 13 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 3859f496f9a..9023e8e9908 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -178,7 +178,7 @@ void ha_close_connection(THD* thd) { #ifdef HAVE_INNOBASE_DB if (!innobase_skip) - innobase_close_connection(THD* thd); + innobase_close_connection(thd); #endif } @@ -236,7 +236,6 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans) my_error(ER_ERROR_DURING_COMMIT, MYF(0), error); error=1; } - trans->innobase_tid=0; } #endif if (error && trans == &thd->transaction.all && mysql_bin_log.is_open()) @@ -263,12 +262,11 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) #ifdef HAVE_INNOBASE_DB if (trans->innobase_tid) { - if ((error=innobase_rollback(thd))) + if ((error=innobase_rollback(thd, trans->innobase_tid))) { my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error); error=1; } - trans->innobase_tid=0; } #endif #ifdef USING_TRANSACTIONS diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1ca7d5ff2ef..ca5d3bc7540 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2450,7 +2450,7 @@ static struct option long_options[] = { #ifdef HAVE_INNOBASE_DB {"innobase_data_home_dir", required_argument, 0, OPT_INNOBASE_DATA_HOME_DIR}, - {"innobase_data_file_path", required_argument, 0, + {"innobase_data_file_path", required_argument, 0, OPT_INNOBASE_DATA_FILE_PATH}, {"innobase_log_group_home_dir", required_argument, 0, OPT_INNOBASE_LOG_GROUP_HOME_DIR}, @@ -2575,15 +2575,15 @@ CHANGEABLE_VAR changeable_vars[] = { #ifdef HAVE_INNOBASE_DB {"innobase_mirrored_log_groups", (long*) &innobase_mirrored_log_groups, 1, 1, 10, 0, 1}, - {"innobase_log_files_in_group", - (long*) &innobase_mirrored_log_groups, 2, 2, 100, 0, 1}, - {"innobase_log_file_size", + {"innobase_log_files_in_group", + (long*) &innobase_log_files_in_group, 2, 2, 100, 0, 1}, + {"innobase_log_file_size", (long*) &innobase_log_file_size, 5*1024*1024L, 1*1024*1024L, ~0L, 0, 1024*1024L}, - {"innobase_log_buffer_size", + {"innobase_log_buffer_size", (long*) &innobase_log_buffer_size, 1024*1024L, 256*1024L, ~0L, 0, 1024}, - {"innobase_buffer_pool_size", + {"innobase_buffer_pool_size", (long*) &innobase_buffer_pool_size, 8*1024*1024L, 1024*1024L, ~0L, 0, 1024*1024L}, {"innobase_additional_mem_pool_size", @@ -2591,6 +2591,9 @@ CHANGEABLE_VAR changeable_vars[] = { ~0L, 0, 1024}, {"innobase_file_io_threads", (long*) &innobase_file_io_threads, 9, 4, 64, 0, 1}, + {"innobase_lock_wait_timeout", + (long*) &innobase_lock_wait_timeout, 1024 * 1024 * 1024, 1, + 1024 * 1024 * 1024, 0, 1}, #endif { "interactive_timeout", (long*) &net_interactive_timeout, NET_WAIT_TIMEOUT, 1, 31*24*60*60, 0, 1 }, @@ -3463,13 +3466,13 @@ static void get_options(int argc,char **argv) case OPT_GEMINI_SKIP: #ifdef HAVE_GEMINI_DB gemini_skip=1; - have_gemini_db=SHOW_OPTION_DISABLED; + have_gemini=SHOW_OPTION_DISABLED; #endif break; case OPT_INNOBASE_SKIP: #ifdef HAVE_INNOBASE_DB innobase_skip=1; - have_innobase_db=SHOW_HAVE_DISABLED; + have_innobase=SHOW_OPTION_DISABLED; #endif break; #ifdef HAVE_INNOBASE_DB diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 854a47fd9c0..ae8846f4039 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -209,7 +209,8 @@ check_connections(THD *thd) /* nasty, but any other way? */ uint pkt_len = 0; { - char buff[60],*end; + /* buff[] needs to big enough to hold the server_version variable */ + char buff[SERVER_VERSION_LENGTH + SCRAMBLE_LENGTH+32],*end; int client_flags = CLIENT_LONG_FLAG | CLIENT_CONNECT_WITH_DB | CLIENT_TRANSACTIONS; LINT_INIT(pkt_len); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6ab286195de..5a2f672368b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -475,6 +475,26 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, make_join_readinfo(&join, (select_options & SELECT_DESCRIBE) | SELECT_USE_CACHE); + + /* Need to tell Innobase that to play it safe, it should fetch all + columns of the tables: this is because MySQL + may build row pointers for the rows, and for all columns of the primary + key the field->query_id has not necessarily been set to thd->query_id + by MySQL. */ + +#ifdef HAVE_INNOBASE_DB + if (need_tmp || select_distinct || group || order) + { + for (uint i_h = join.const_tables; i_h < join.tables; i_h++) + { + JOIN_TAB* tab_h = join.join_tab + i_h; + TABLE* table_h = tab_h->table; + if (table_h->db_type == DB_TYPE_INNOBASE) + table_h->file->extra(HA_EXTRA_RESTORE_POS); + } + } +#endif + DBUG_EXECUTE("info",TEST_join(&join);); /* Because filesort always does a full table scan or a quick range scan |