mysql-5.1 merge

mysys/errors.c:
  revert upstream's fix. use a much simpler one
mysys/my_write.c:
  revert upstream's fix. use a simpler one
sql/item_xmlfunc.cc:
  useless, but ok
sql/mysqld.cc:
  simplify upstream's fix
storage/heap/hp_delete.c:
  remove upstream's fix.
  we'll use a much less expensive approach.
This commit is contained in:
Sergei Golubchik 2013-02-28 09:58:39 +01:00
commit 08ba257846
104 changed files with 1961 additions and 1009 deletions

View file

@ -2738,8 +2738,8 @@ void Query_cache::invalidate_table(THD *thd, TABLE_LIST *table_list)
char key[MAX_DBKEY_LENGTH];
uint key_length;
key_length=(uint) (strmov(strmov(key,table_list->db)+1,
table_list->table_name) -key)+ 1;
key_length= create_table_def_key(key, table_list->db,
table_list->table_name);
// We don't store temporary tables => no key_length+=4 ...
invalidate_table(thd, (uchar *)key, key_length);
@ -2860,8 +2860,8 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
DBUG_PRINT("qcache", ("view: %s db: %s",
tables_used->view_name.str,
tables_used->view_db.str));
key_length= (uint) (strmov(strmov(key, tables_used->view_db.str) + 1,
tables_used->view_name.str) - key) + 1;
key_length= create_table_def_key(key, tables_used->view_db.str,
tables_used->view_name.str);
/*
There are not callback function for for VIEWs
*/
@ -3923,14 +3923,13 @@ my_bool Query_cache::move_by_type(uchar **border,
case Query_cache_block::RESULT:
{
DBUG_PRINT("qcache", ("block 0x%lx RES* (%d)", (ulong) block,
(int) block->type));
(int) block->type));
if (*border == 0)
break;
Query_cache_block *query_block = block->result()->parent(),
*next = block->next,
*prev = block->prev;
Query_cache_block::block_type type = block->type;
Query_cache_block *query_block= block->result()->parent();
BLOCK_LOCK_WR(query_block);
Query_cache_block *next= block->next, *prev= block->prev;
Query_cache_block::block_type type= block->type;
ulong len = block->length, used = block->used;
Query_cache_block *pprev = block->pprev,
*pnext = block->pnext,
@ -4092,8 +4091,9 @@ uint Query_cache::filename_2_table_key (char *key, const char *path,
*db_length= (filename - dbname) - 1;
DBUG_PRINT("qcache", ("table '%-.*s.%s'", *db_length, dbname, filename));
DBUG_RETURN((uint) (strmov(strmake(key, dbname, *db_length) + 1,
filename) -key) + 1);
DBUG_RETURN((uint) (strmake(strmake(key, dbname,
min(*db_length, NAME_LEN)) + 1,
filename, NAME_LEN) - key) + 1);
}
/****************************************************************************