diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-06-26 17:34:44 +0300 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-06-26 17:34:44 +0300 |
| commit | c6392d52ee2e918a65b05c275286ff4d450eef2c (patch) | |
| tree | 1a5f9623ff08bfca9eacb83e21502563e656e932 /sql | |
| parent | c4eb4bcef648eb2ebdc6edc06905f39f95ef7f6b (diff) | |
| parent | cc8772f33e8f94844e32f3aa79e5f41d784f8ec0 (diff) | |
| download | mariadb-git-c6392d52ee2e918a65b05c275286ff4d450eef2c.tar.gz | |
Merge 10.0 into 10.1
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/ha_partition.cc | 3 | ||||
| -rw-r--r-- | sql/handler.h | 10 | ||||
| -rw-r--r-- | sql/log_event.cc | 4 | ||||
| -rw-r--r-- | sql/sql_statistics.cc | 6 |
4 files changed, 14 insertions, 9 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 34c253cc48a..7444d61b3fc 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -5071,7 +5071,8 @@ int ha_partition::rnd_pos_by_record(uchar *record) if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part))) DBUG_RETURN(1); - DBUG_RETURN(handler::rnd_pos_by_record(record)); + int err= m_file[m_last_part]->rnd_pos_by_record(record); + DBUG_RETURN(err); } diff --git a/sql/handler.h b/sql/handler.h index a047f276349..d17bccab25c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3180,9 +3180,17 @@ private: */ virtual int rnd_pos_by_record(uchar *record) { + int error; DBUG_ASSERT(table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION); + + error = ha_rnd_init(false); + if (error != 0) + return error; + position(record); - return rnd_pos(record, ref); + error = ha_rnd_pos(record, ref); + ha_rnd_end(); + return error; } virtual int read_first_row(uchar *buf, uint primary_key); public: diff --git a/sql/log_event.cc b/sql/log_event.cc index 3ac7ac5a20f..9ccbb45d01c 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -12169,10 +12169,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi) int error; DBUG_PRINT("info",("locating record using primary key (position)")); - if (!table->file->inited && - (error= table->file->ha_rnd_init_with_error(0))) - DBUG_RETURN(error); - error= table->file->ha_rnd_pos_by_record(table->record[0]); if (error) { diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index b7ccbb5c212..abf3975dd9c 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3091,7 +3091,7 @@ bool statistics_for_tables_is_needed(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *tl= tables; tl; tl= tl->next_global) { - if (!tl->is_view_or_derived() && tl->table) + if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table) { TABLE_SHARE *table_share= tl->table->s; if (table_share && @@ -3103,7 +3103,7 @@ bool statistics_for_tables_is_needed(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *tl= tables; tl; tl= tl->next_global) { - if (!tl->is_view_or_derived() && tl->table) + if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table) { TABLE_SHARE *table_share= tl->table->s; if (table_share && @@ -3232,7 +3232,7 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *tl= tables; tl; tl= tl->next_global) { - if (!tl->is_view_or_derived() && tl->table) + if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table) { TABLE_SHARE *table_share= tl->table->s; if (table_share && |
