~michaeleguo/ubuntu/trusty/percona-xtradb-cluster-5.5/arm64fix

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/rr_trx/t/rr_sc_select-same_2.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-10 14:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20140210144423-f2134l2gxuvq2m6l
Tags: upstream-5.5.34-25.9+dfsg
ImportĀ upstreamĀ versionĀ 5.5.34-25.9+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
#
 
3
# This test contains a single transaction performing queries against the test
 
4
# data. The main purpose is to test REPEATABLE READ results, that is to verify
 
5
# that reads (SELECTs) are indeed repeatable during a REPEATABLE READ 
 
6
# transaction. 
 
7
#
 
8
# Generally, queries which should yield the same results at one moment in time 
 
9
# should also yield the same results later in the same transaction. In some 
 
10
# configurations, however, phantom reads are allowed (may e.g. depend on 
 
11
# settings such as falcon_consistent_read).
 
12
#
 
13
# To detect missing rows, modified rows and possibly invalid (uncommitted) 
 
14
# extra (phantom) rows, we store query results in temporary tables and compare 
 
15
# using special queries. Using includes for this to avoid unnecessary "clutter"
 
16
# in each select-only test.
 
17
#
 
18
# This and similar tests (transactions) should contain some random "filler"
 
19
# between the SELECTs so that they may run in different conditions, such as:
 
20
#   * some other transactions may have commited in the meantime
 
21
#   * a scavenge run may have happened (falcon)
 
22
#   * etc
 
23
#
 
24
# Such a "random filler" can be:
 
25
#   * SLEEP()
 
26
#   * Bogus updates on some unrelated temporary table that was created for the purpose
 
27
#   * savepoint + bogus updates on the main tables + rollback to savepoint
 
28
#   * Inserts on new records (which will show up as "phantom" records in subsequent SELECTs) 
 
29
#
 
30
################################################################################
 
31
 
 
32
SET autocommit = 0;
 
33
START TRANSACTION;
 
34
 
 
35
# We do a full table scan in this test.
 
36
# Note: May cause deadlocks! (handled in sourced scripts).
 
37
 
 
38
let $query= SELECT * from t1;
 
39
--source suite/engines/rr_trx/include/record_query_all_columns.inc
 
40
SELECT SLEEP(1);
 
41
let $query= SELECT * from t1;
 
42
--source suite/engines/rr_trx/include/record_query_all_columns.inc
 
43
--source suite/engines/rr_trx/include/check_repeatable_read_all_columns.inc
 
44
 
 
45
COMMIT;