fixes for test failures

and small collateral changes

mysql-test/lib/My/Test.pm:
  somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
  this differs, because we don't rewrite general log queries, and multi-statement
  packets are logged as a one entry. this result file is identical to what mysql-5.6.5
  produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
  MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
  MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
  this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
  do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
  will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
  will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
This commit is contained in:
Sergei Golubchik 2012-09-27 20:09:46 +02:00
commit 474fe6d9d9
477 changed files with 33810 additions and 9079 deletions

View file

@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010, 2012, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -10,8 +11,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/*
Description of the query cache:
@ -411,23 +412,28 @@ const uchar *query_state_map;
struct Query_cache_wait_state
{
THD *m_thd;
const char *m_proc_info;
PSI_stage_info m_old_stage;
const char *m_func;
const char *m_file;
int m_line;
Query_cache_wait_state(THD *thd, const char *func,
const char *file, unsigned int line)
: m_thd(thd),
m_proc_info(NULL)
m_old_stage(),
m_func(func), m_file(file), m_line(line)
{
if (m_thd)
m_proc_info= set_thd_proc_info(m_thd,
"Waiting for query cache lock",
func, file, line);
set_thd_stage_info(m_thd,
&stage_waiting_for_query_cache_lock,
&m_old_stage,
m_func, m_file, m_line);
}
~Query_cache_wait_state()
{
if (m_thd)
set_thd_proc_info(m_thd, m_proc_info, NULL, NULL, 0);
set_thd_stage_info(m_thd, &m_old_stage, NULL, m_func, m_file, m_line);
}
};
@ -1140,7 +1146,7 @@ Query_cache::abort(Query_cache_tls *query_cache_tls)
if (query_block)
{
thd= current_thd;
thd_proc_info(thd, "storing result in query cache");
THD_STAGE_INFO(thd, stage_storing_result_in_query_cache);
DUMP(this);
BLOCK_LOCK_WR(query_block);
// The following call will remove the lock on query_block
@ -1191,7 +1197,7 @@ void Query_cache::end_of_result(THD *thd)
suitable size if needed and setting block type. Since this is the last
block, the writer should be dropped.
*/
thd_proc_info(thd, "storing result in query cache");
THD_STAGE_INFO(thd, stage_storing_result_in_query_cache);
DUMP(this);
BLOCK_LOCK_WR(query_block);
Query_cache_query *header= query_block->query();
@ -1847,7 +1853,7 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length)
DBUG_PRINT("qcache", ("No active database"));
}
thd_proc_info(thd, "checking query cache for query");
THD_STAGE_INFO(thd, stage_checking_query_cache_for_query);
// fill all gaps between fields with 0 to get repeatable key
bzero(&flags, QUERY_CACHE_FLAGS_SIZE);
@ -1938,7 +1944,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
}
// Check access;
thd_proc_info(thd, "checking privileges on cached query");
THD_STAGE_INFO(thd, stage_checking_privileges_on_cached_query);
block_table= query_block->table(0);
block_table_end= block_table+query_block->n_tables;
for (; block_table != block_table_end; block_table++)
@ -2044,7 +2050,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
Send cached result to client
*/
#ifndef EMBEDDED_LIBRARY
thd_proc_info(thd, "sending cached result to client");
THD_STAGE_INFO(thd, stage_sending_cached_result_to_client);
do
{
DBUG_PRINT("qcache", ("Results (len: %lu used: %lu headers: %lu)",
@ -2145,7 +2151,7 @@ void Query_cache::invalidate(THD *thd, CHANGED_TABLE_LIST *tables_used)
for (; tables_used; tables_used= tables_used->next)
{
thd_proc_info(thd, "invalidating query cache entries (table list)");
THD_STAGE_INFO(thd, stage_invalidating_query_cache_entries_table_list);
invalidate_table(thd, (uchar*) tables_used->key, tables_used->key_length);
DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key,
tables_used->key+
@ -2174,7 +2180,7 @@ void Query_cache::invalidate_locked_for_write(THD *thd,
for (; tables_used; tables_used= tables_used->next_local)
{
thd_proc_info(thd, "invalidating query cache entries (table)");
THD_STAGE_INFO(thd, stage_invalidating_query_cache_entries_table);
if (tables_used->lock_type >= TL_WRITE_ALLOW_WRITE &&
tables_used->table)
{
@ -2302,6 +2308,9 @@ void Query_cache::invalidate_by_MyISAM_filename(const char *filename)
{
DBUG_ENTER("Query_cache::invalidate_by_MyISAM_filename");
if (is_disabled())
DBUG_VOID_RETURN;
/* Calculate the key outside the lock to make the lock shorter */
char key[MAX_DBKEY_LENGTH];
uint32 db_length;