diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-06-05 16:53:36 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-06-05 16:53:36 +0200 |
commit | ac6b3c44308b61ebf0ed5ac20e93a1ee3cd61b99 (patch) | |
tree | 9e3c64b787717fc52c6dada3856af6f1f12d2897 /sql/tztime.cc | |
parent | 59eb4f6aa04c49d4983350ade529d6106aa991e6 (diff) | |
download | mariadb-git-ac6b3c44308b61ebf0ed5ac20e93a1ee3cd61b99.tar.gz |
few small MySQL bugs/issues that impact the engines, as discussed in the SE summit
* remove handler::index_read_last()
* create handler::keyread_read_time() (was get_index_only_read_time() in opt_range.cc)
* ha_show_status() allows engine's show_status() to fail
* remove HTON_FLUSH_AFTER_RENAME
* fix key_cmp_if_same() to work for floats and doubles
* set table->status in the server, don't force engines to do it
* increment status vars in the server, don't force engines to do it
mysql-test/r/status_user.result:
correct test results - innodb was wrongly counting internal
index searches as handler_read_* calls.
sql/ha_partition.cc:
compensate for handler incrementing status counters -
we want to count only calls to underlying engines
sql/handler.h:
inline methods moved to sql_class.h
sql/key.cc:
simplify the check
sql/opt_range.cc:
move get_index_only_read_time to the handler class
sql/sp.cc:
don't use a key that's stored in the record buffer -
the engine can overwrite the buffer with anything, destroying the key
sql/sql_class.h:
inline handler methods that need to see THD and TABLE definitions
sql/sql_select.cc:
no ha_index_read_last_map anymore
sql/sql_table.cc:
remove HTON_FLUSH_AFTER_RENAME
sql/table.cc:
set HA_CAN_MEMCMP as appropriate
sql/tztime.cc:
don't use a key that's stored in the record buffer -
the engine can overwrite the buffer with anything, destroying the key
storage/myisam/ha_myisam.cc:
engines don't need to update table->status or use ha_statistic_increment anymore
storage/myisam/ha_myisam.h:
index_read_last_map is no more
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r-- | sql/tztime.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc index 3802c284057..457bbeec676 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1813,6 +1813,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) uint tzid, ttid; my_time_t ttime; char buff[MAX_FIELD_WIDTH]; + uchar keybuff[32]; String abbr(buff, sizeof(buff), &my_charset_latin1); char *alloc_buff, *tz_name_buff; /* @@ -1891,9 +1892,10 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) table= tz_tables->table; tz_tables= tz_tables->next_local; table->field[0]->store((longlong) tzid, TRUE); + table->field[0]->get_key_image(keybuff, sizeof(keybuff), Field::itRAW); (void)table->file->ha_index_init(0, 1); - if (table->file->ha_index_read_map(table->record[0], table->field[0]->ptr, + if (table->file->ha_index_read_map(table->record[0], keybuff, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { sql_print_error("Can't find description of time zone '%u'", tzid); @@ -1918,9 +1920,10 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) table= tz_tables->table; tz_tables= tz_tables->next_local; table->field[0]->store((longlong) tzid, TRUE); + table->field[0]->get_key_image(keybuff, sizeof(keybuff), Field::itRAW); (void)table->file->ha_index_init(0, 1); - res= table->file->ha_index_read_map(table->record[0], table->field[0]->ptr, + res= table->file->ha_index_read_map(table->record[0], keybuff, (key_part_map)1, HA_READ_KEY_EXACT); while (!res) { @@ -1968,8 +1971,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) tmp_tz_info.typecnt= ttid + 1; - res= table->file->ha_index_next_same(table->record[0], - table->field[0]->ptr, 4); + res= table->file->ha_index_next_same(table->record[0], keybuff, 4); } if (res != HA_ERR_END_OF_FILE) @@ -1991,7 +1993,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) table->field[0]->store((longlong) tzid, TRUE); (void)table->file->ha_index_init(0, 1); - res= table->file->ha_index_read_map(table->record[0], table->field[0]->ptr, + res= table->file->ha_index_read_map(table->record[0], keybuff, (key_part_map)1, HA_READ_KEY_EXACT); while (!res) { @@ -2021,8 +2023,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) ("time_zone_transition table: tz_id: %u tt_time: %lu tt_id: %u", tzid, (ulong) ttime, ttid)); - res= table->file->ha_index_next_same(table->record[0], - table->field[0]->ptr, 4); + res= table->file->ha_index_next_same(table->record[0], keybuff, 4); } /* |