Debian Codegraph @

mysql-test/suite/innodb/t/lob-read-uncommitted.test

raw
1 --source include/have_debug.inc
2 --source include/count_sessions.inc
3 --source include/have_innodb_max_16k.inc
4
5 --echo #
6 --echo # Bug #27624990 ASSERTION `FALSE' FAILED AT BOOL WRAPPER_TO_STRING() IN SQL/JSON_DOM.CC
7 --echo #
8
9 --echo #
10 --echo # Scenario 1: The row format is DYNAMIC (no blob prefix). The READ
11 --echo # UNCOMMITTED transaction will see the new value of column f1 but
12 --echo # old value of column f2.
13 --echo #
14
15 create table t1 (f1 int, f2 longblob) row_format=dynamic;
16 show create table t1;
17 insert into t1 values (1, repeat('x', 40000));
18
19 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert';
20 --send update t1 set f1 = 2, f2 = repeat('y', 100000) where f1 = 1;
21
22 connect (con1,localhost,root,,);
23 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
24 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
25 begin;
26 select f1, f2 from t1;
27 commit;
28 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
29
30 connection default;
31 --reap
32 disconnect con1;
33
34 drop table t1;
35
36 --source include/wait_until_count_sessions.inc
37
38 --echo #
39 --echo # Scenario 2: The row format is REDUNDANT (no blob prefix). The READ
40 --echo # UNCOMMITTED transaction will see only the local prefix of f2.
41 --echo #
42
43 create table t1 (f1 int primary key, f2 longblob) row_format=redundant;
44 show create table t1;
45 insert into t1 values (1, repeat('x', 40000));
46
47 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert EXECUTE 2';
48 --send update t1 set f2 = repeat('y', 100000) where f1 = 1;
49
50 connect (con1,localhost,root,,);
51 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
52 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
53 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
54 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
55 begin;
56 select length(f2) from t1 where f1 = 1;
57 commit;
58 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
59
60 connection default;
61 --reap
62 disconnect con1;
63
64 drop table t1;
65
66 --source include/wait_until_count_sessions.inc
67
68 --echo #
69 --echo # Scenario 3: The row format is REDUNDANT (no blob prefix). The READ
70 --echo # UNCOMMITTED transaction will see the local prefix of new blob and
71 --echo # the external part of the old blob.
72 --echo #
73
74 create table t1 (f1 int primary key, f2 longblob) row_format=redundant;
75 show create table t1;
76 insert into t1 values (1, repeat('x', 40000));
77
78 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert';
79 --send update t1 set f2 = repeat('y', 100000) where f1 = 1;
80
81 connect (con1,localhost,root,,);
82 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
83 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
84 begin;
85 select f2 from t1 where f1 = 1;
86 commit;
87 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
88
89 connection default;
90 --reap
91 disconnect con1;
92
93 drop table t1;
94
95 --source include/wait_until_count_sessions.inc
96
97 --echo #
98 --echo # Scenario 4: The row format is REDUNDANT (no blob prefix).
99 --echo # The READ UNCOMMITTED transaction will see the local prefix
100 --echo # of new blob and external part of old blob. It is different
101 --echo # from Scenario 3 because this involves blob operation code
102 --echo # OPCODE_INSERT_UPDATE.
103 --echo #
104
105 create table t1 (f1 int primary key, f2 longblob) row_format=redundant;
106 show create table t1;
107 start transaction;
108 insert into t1 values (1, repeat('x', 40000));
109 delete from t1 where f1 = 1;
110
111 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert';
112 --send insert into t1 values (1, repeat('y', 40000));
113
114 connect (con1,localhost,root,,);
115 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
116 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
117 begin;
118 select f2 from t1 where f1 = 1;
119 commit;
120 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
121
122 connection default;
123 --reap
124 commit;
125 disconnect con1;
126
127 drop table t1;
128
129 --source include/wait_until_count_sessions.inc
130