File: binlog_gtid_mix_response_packet.inc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (77 lines) | stat: -rw-r--r-- 1,514 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# WL#6972: Collect GTIDs to include in the protocol's OK packet

# The test goes like this:
# 1. Statements are executed and depending whether they are
#    updates or not, they get GTID assigned
# 2. After each statement, we track the contents of the return packet.
#    They are saved to the result file.
#
#
# Scenarios tested:
# 1. DDL
# 2. Explicit RW transaction
# 3. Implicit RW transaction commit
# 4. RO transaction following an RW autocommit transaction
# 5. Finally DDL again
#
# These scenarios are tested for all three values of the
# variable SESSION_TRACK_GTIDS
#

--let $uuid= `SELECT @@server_uuid`
--let $i=3

--enable_session_track_info

while($i)
{
  if ($i == 3)
  {
    --let $_option= ALL_GTIDS
  }
  if ($i == 2)
  {
    --let $_option= OWN_GTID
  }
  if ($i == 1)
  {
    --let $_option= OFF
  }

  --eval SET SESSION SESSION_TRACK_GTIDS=$_option
  RESET MASTER;

  # transaction 1 - $uuid:1
  CREATE TABLE t1 (c1 INT) Engine=InnoDB;

  # transaction 2 - $uuid:2
  BEGIN;
  INSERT INTO t1 VALUES (1);
  COMMIT;

  # transaction $uuid:3 and $uuid:4
  BEGIN;
  INSERT INTO t1 VALUES (2);
  CREATE TABLE t2 (c1 INT) Engine=InnoDB;

  # Testing RO transaction following a RW transaction

  # transaction $uuid:5
  INSERT INTO t2 VALUES (1);
  # RO transaction
  SELECT * FROM t1;

  BEGIN;
  INSERT INTO t1 VALUES (2);
  SAVEPOINT s;
  INSERT INTO t1 VALUES (3);
  ROLLBACK TO SAVEPOINT s;
  ROLLBACK;

  # transaction $uuid:6
  DROP TABLE t1, t2;

  --dec $i
}
--disable_session_track_info