diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-02-24 14:37:00 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-02-24 14:37:00 +0100 |
commit | 3f28115e0ee810de2772fdc69d6965058a0b5d2f (patch) | |
tree | a14bb01c316d353c5b6c217b7198cf4148ae50e5 /sql | |
parent | db39910f080534159ce8c7d55fa458365de7c3f3 (diff) | |
parent | c068b831aca6334c6dea01fd9ff54b6140a52ef6 (diff) | |
download | mariadb-git-3f28115e0ee810de2772fdc69d6965058a0b5d2f.tar.gz |
5.3 merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.cc | 6 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 8 | ||||
-rw-r--r-- | sql/item_timefunc.h | 5 | ||||
-rw-r--r-- | sql/multi_range_read.cc | 12 | ||||
-rw-r--r-- | sql/mysqld.cc | 16 | ||||
-rw-r--r-- | sql/sql_class.h | 10 | ||||
-rw-r--r-- | sql/sql_handler.cc | 2 | ||||
-rw-r--r-- | sql/sql_join_cache.cc | 12 |
8 files changed, 31 insertions, 40 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 5f8a64e486c..50db743a8ff 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4631,10 +4631,10 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg) if (h->end_range && h->compare_key2(h->end_range) > 0) return ICP_OUT_OF_RANGE; - h->increment_statistics(&SSV::ha_pushed_index_cond_checks); + h->increment_statistics(&SSV::ha_icp_attempts); if ((res= h->pushed_idx_cond->val_int()? ICP_MATCH : ICP_NO_MATCH) == - ICP_NO_MATCH) - h->increment_statistics(&SSV::ha_pushed_index_cond_filtered); + ICP_MATCH) + h->increment_statistics(&SSV::ha_icp_match); return res; } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 30357a1bbe8..80914f499fe 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1199,15 +1199,7 @@ bool Item_func_unix_timestamp::get_timestamp_value(my_time_t *seconds, MYSQL_TIME ltime; if (get_arg0_date(<ime, 0)) - { - /* - We have to set null_value again because get_arg0_date will also set it - to true if we have wrong datetime parameter (and we should return 0 in - this case). - */ - null_value= args[0]->null_value; return 1; - } uint error_code; *seconds= TIME_to_timestamp(current_thd, <ime, &error_code); diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index d9e58857c9d..f6d08105cf4 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -436,11 +436,6 @@ public: enum_monotonicity_info get_monotonicity_info() const; longlong val_int_endpoint(bool left_endp, bool *incl_endp); bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - void fix_num_length_and_dec() - { - maybe_null= false; - Item_func_seconds_hybrid::fix_num_length_and_dec(); - } /* UNIX_TIMESTAMP() depends on the current timezone (and thus may not be used as a partitioning function) diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index 29e7faa630d..7268491c0f4 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -526,7 +526,7 @@ int Mrr_ordered_index_reader::refill_buffer(bool initial) { /* This is a non-initial buffer fill and we've got a non-empty buffer */ THD *thd= current_thd; - status_var_increment(thd->status_var.ha_mrr_extra_key_sorts); + status_var_increment(thd->status_var.ha_mrr_key_refills_count); } key_buffer->sort((key_buffer->type() == Lifo_buffer::FORWARD)? @@ -626,7 +626,7 @@ int Mrr_ordered_rndpos_reader::refill_buffer(bool initial) { /* Ok, this was a successful buffer refill operation */ THD *thd= current_thd; - status_var_increment(thd->status_var.ha_mrr_extra_rowid_sorts); + status_var_increment(thd->status_var.ha_mrr_rowid_refills_count); } DBUG_RETURN(res); @@ -861,8 +861,6 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, strategy= disk_strategy= &reader_factory.ordered_rndpos_reader; } - status_var_increment(thd->status_var.ha_multi_range_read_init_count); - full_buf= buf->buffer; full_buf_end= buf->buffer_end; @@ -952,6 +950,12 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, goto error; } } + + /* + At this point, we're sure that we're running a native MRR scan (i.e. we + didnt fall back to default implementation for some reason). + */ + status_var_increment(thd->status_var.ha_mrr_init_count); res= strategy->refill_buffer(TRUE); if (res) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e5b9a6e6312..8f668c83489 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6869,15 +6869,15 @@ SHOW_VAR status_vars[]= { {"Handler_commit", (char*) offsetof(STATUS_VAR, ha_commit_count), SHOW_LONG_STATUS}, {"Handler_delete", (char*) offsetof(STATUS_VAR, ha_delete_count), SHOW_LONG_STATUS}, {"Handler_discover", (char*) offsetof(STATUS_VAR, ha_discover_count), SHOW_LONG_STATUS}, -#if 0 - /* Made 3 counters below temporarily invisible until we agree upon their names */ - {"Handler_mrr_extra_key_sorts", (char*) offsetof(STATUS_VAR, ha_mrr_extra_key_sorts), SHOW_LONG_STATUS}, - {"Handler_mrr_extra_rowid_sorts", (char*) offsetof(STATUS_VAR, ha_mrr_extra_rowid_sorts), SHOW_LONG_STATUS}, - {"Handler_mrr_init", (char*) offsetof(STATUS_VAR, ha_multi_range_read_init_count), SHOW_LONG_STATUS}, -#endif + + {"Handler_icp_attempts ", (char*) offsetof(STATUS_VAR, ha_icp_attempts), SHOW_LONG_STATUS}, + {"Handler_icp_match", (char*) offsetof(STATUS_VAR, ha_icp_match), SHOW_LONG_STATUS}, + + {"Handler_mrr_init", (char*) offsetof(STATUS_VAR, ha_mrr_init_count), SHOW_LONG_STATUS}, + {"Handler_mrr_key_refills", (char*) offsetof(STATUS_VAR, ha_mrr_key_refills_count), SHOW_LONG_STATUS}, + {"Handler_mrr_rowid_refills", (char*) offsetof(STATUS_VAR, ha_mrr_rowid_refills_count), SHOW_LONG_STATUS}, + {"Handler_prepare", (char*) offsetof(STATUS_VAR, ha_prepare_count), SHOW_LONG_STATUS}, - {"Handler_pushed_index_cond_checks",(char*) offsetof(STATUS_VAR, ha_pushed_index_cond_checks), SHOW_LONG_STATUS}, - {"Handler_pushed_index_cond_filtered",(char*) offsetof(STATUS_VAR, ha_pushed_index_cond_filtered), SHOW_LONG_STATUS}, {"Handler_read_first", (char*) offsetof(STATUS_VAR, ha_read_first_count), SHOW_LONG_STATUS}, {"Handler_read_key", (char*) offsetof(STATUS_VAR, ha_read_key_count), SHOW_LONG_STATUS}, {"Handler_read_last", (char*) offsetof(STATUS_VAR, ha_read_last_count), SHOW_LONG_STATUS}, diff --git a/sql/sql_class.h b/sql/sql_class.h index 980189ae9e0..b3aca00343e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -591,9 +591,9 @@ typedef struct system_status_var calls made by range access. The intent is to count only calls made by BatchedKeyAccess. */ - ulong ha_multi_range_read_init_count; - ulong ha_mrr_extra_key_sorts; - ulong ha_mrr_extra_rowid_sorts; + ulong ha_mrr_init_count; + ulong ha_mrr_key_refills_count; + ulong ha_mrr_rowid_refills_count; ulong ha_rollback_count; ulong ha_update_count; @@ -602,8 +602,8 @@ typedef struct system_status_var ulong ha_tmp_update_count; ulong ha_tmp_write_count; ulong ha_prepare_count; - ulong ha_pushed_index_cond_checks; - ulong ha_pushed_index_cond_filtered; + ulong ha_icp_attempts; + ulong ha_icp_match; ulong ha_discover_count; ulong ha_savepoint_count; ulong ha_savepoint_rollback_count; diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 0439a3c8265..c67618f0680 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -750,7 +750,7 @@ retry: if (handler->lock->lock_count > 0) { - bool lock_error; + int lock_error; handler->lock->locks[0]->type= handler->lock->locks[0]->org_type; diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index f4fe8790bf7..e0e1b175116 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -4027,9 +4027,9 @@ bool bka_skip_index_tuple(range_seq_t rseq, range_id_t range_info) JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq; THD *thd= cache->thd(); bool res; - status_var_increment(thd->status_var.ha_pushed_index_cond_checks); - if ((res= cache->skip_index_tuple(range_info))) - status_var_increment(thd->status_var.ha_pushed_index_cond_filtered); + status_var_increment(thd->status_var.ha_icp_attempts); + if (!(res= cache->skip_index_tuple(range_info))) + status_var_increment(thd->status_var.ha_icp_match); DBUG_RETURN(res); } @@ -4506,9 +4506,9 @@ bool bkah_skip_index_tuple(range_seq_t rseq, range_id_t range_info) JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq; THD *thd= cache->thd(); bool res; - status_var_increment(thd->status_var.ha_pushed_index_cond_checks); - if ((res= cache->skip_index_tuple(range_info))) - status_var_increment(thd->status_var.ha_pushed_index_cond_filtered); + status_var_increment(thd->status_var.ha_icp_attempts); + if (!(res= cache->skip_index_tuple(range_info))) + status_var_increment(thd->status_var.ha_icp_match); DBUG_RETURN(res); } |