~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/include/kill_query_and_diff_master_slave.inc

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ==== Purpose ====
 
2
#
 
3
# Kill a query, sync master with slave, and diff the output of a
 
4
# statement on master and slave to check if statement is correctly
 
5
# replicated.
 
6
#
 
7
# ==== Usage ====
 
8
#
 
9
# connection <CONNECTION>;
 
10
# let $connection_name=<CONNECTION>
 
11
# let $connection_id=`SELECT CONNECTION_ID()`;
 
12
# let $diff_statement=<SQL COMMAND>;
 
13
# send <SQL COMMAND>;
 
14
# source include/kill_query_and_diff_master_slave.inc;
 
15
#
 
16
# Note: <CONNECTION> must not be 'master'.
 
17
#
 
18
# See also kill_query.inc and diff_master_slave.inc for more
 
19
# information
 
20
 
 
21
source include/kill_query.inc;
 
22
 
 
23
# Release the debug lock if used, so that the statements in
 
24
# diff_master_slave.inc will not be blocked.
 
25
connection master;
 
26
disable_query_log;
 
27
disable_result_log;
 
28
if (`SELECT '$debug_lock' != ''`)
 
29
{
 
30
  eval SELECT RELEASE_LOCK($debug_lock);
 
31
}
 
32
enable_result_log;
 
33
enable_query_log;
 
34
 
 
35
source include/diff_master_slave.inc;
 
36
 
 
37
# Acquire the debug lock again if used
 
38
connection master;
 
39
disable_query_log; disable_result_log; if (`SELECT '$debug_lock' !=
 
40
''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log;
 
41
enable_query_log;
 
42
 
 
43
connection $connection_name;