summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-06-05 16:53:36 +0200
committerSergei Golubchik <sergii@pisem.net>2010-06-05 16:53:36 +0200
commitac6b3c44308b61ebf0ed5ac20e93a1ee3cd61b99 (patch)
tree9e3c64b787717fc52c6dada3856af6f1f12d2897 /sql/sp.cc
parent59eb4f6aa04c49d4983350ade529d6106aa991e6 (diff)
downloadmariadb-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/sp.cc')
-rw-r--r--sql/sp.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 4d4b9728aad..ac509a3bb2d 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1276,6 +1276,7 @@ sp_drop_db_routines(THD *thd, char *db)
TABLE *table;
int ret;
uint key_len;
+ uchar keybuf[MAX_KEY_LENGTH];
DBUG_ENTER("sp_drop_db_routines");
DBUG_PRINT("enter", ("db: %s", db));
@@ -1285,12 +1286,14 @@ sp_drop_db_routines(THD *thd, char *db)
table->field[MYSQL_PROC_FIELD_DB]->store(db, strlen(db), system_charset_info);
key_len= table->key_info->key_part[0].store_length;
+ table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW);
+
+
ret= SP_OK;
table->file->ha_index_init(0, 1);
- if (!table->file->ha_index_read_map(table->record[0],
- (uchar *) table->field[MYSQL_PROC_FIELD_DB]->ptr,
- (key_part_map)1, HA_READ_KEY_EXACT))
+ if (!table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1,
+ HA_READ_KEY_EXACT))
{
int nxtres;
bool deleted= FALSE;
@@ -1305,11 +1308,8 @@ sp_drop_db_routines(THD *thd, char *db)
nxtres= 0;
break;
}
- } while (!(nxtres= table->file->
- ha_index_next_same(table->record[0],
- (uchar *)table->field[MYSQL_PROC_FIELD_DB]->
- ptr,
- key_len)));
+ } while (!(nxtres= table->file->ha_index_next_same(table->record[0],
+ keybuf, key_len)));
if (nxtres != HA_ERR_END_OF_FILE)
ret= SP_KEY_NOT_FOUND;
if (deleted)