Debian Codegraph @

mysql-test/suite/innodb/r/lob-read-uncommitted.result

raw
1 #
2 # Bug #27624990 ASSERTION `FALSE' FAILED AT BOOL WRAPPER_TO_STRING() IN SQL/JSON_DOM.CC
3 #
4 #
5 # Scenario 1: The row format is DYNAMIC (no blob prefix). The READ
6 # UNCOMMITTED transaction will see the new value of column f1 but
7 # old value of column f2.
8 #
9 create table t1 (f1 int, f2 longblob) row_format=dynamic;
10 show create table t1;
11 Table Create Table
12 t1 CREATE TABLE `t1` (
13 `f1` int DEFAULT NULL,
14 `f2` longblob
15 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC
16 insert into t1 values (1, repeat('x', 40000));
17 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert';
18 update t1 set f1 = 2, f2 = repeat('y', 100000) where f1 = 1;;
19 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
20 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
21 begin;
22 select f1, f2 from t1;
23 f1 f2
24 2
25 commit;
26 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
27 drop table t1;
28 #
29 # Scenario 2: The row format is REDUNDANT (no blob prefix). The READ
30 # UNCOMMITTED transaction will see only the local prefix of f2.
31 #
32 create table t1 (f1 int primary key, f2 longblob) row_format=redundant;
33 show create table t1;
34 Table Create Table
35 t1 CREATE TABLE `t1` (
36 `f1` int NOT NULL,
37 `f2` longblob,
38 PRIMARY KEY (`f1`)
39 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=REDUNDANT
40 insert into t1 values (1, repeat('x', 40000));
41 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert EXECUTE 2';
42 update t1 set f2 = repeat('y', 100000) where f1 = 1;;
43 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
44 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
45 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
46 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
47 begin;
48 select length(f2) from t1 where f1 = 1;
49 length(f2)
50 0
51 commit;
52 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
53 drop table t1;
54 #
55 # Scenario 3: The row format is REDUNDANT (no blob prefix). The READ
56 # UNCOMMITTED transaction will see the local prefix of new blob and
57 # the external part of the old blob.
58 #
59 create table t1 (f1 int primary key, f2 longblob) row_format=redundant;
60 show create table t1;
61 Table Create Table
62 t1 CREATE TABLE `t1` (
63 `f1` int NOT NULL,
64 `f2` longblob,
65 PRIMARY KEY (`f1`)
66 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=REDUNDANT
67 insert into t1 values (1, repeat('x', 40000));
68 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert';
69 update t1 set f2 = repeat('y', 100000) where f1 = 1;;
70 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
71 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
72 begin;
73 select f2 from t1 where f1 = 1;
74 f2
75
76 commit;
77 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
78 drop table t1;
79 #
80 # Scenario 4: The row format is REDUNDANT (no blob prefix).
81 # The READ UNCOMMITTED transaction will see the local prefix
82 # of new blob and external part of old blob. It is different
83 # from Scenario 3 because this involves blob operation code
84 # OPCODE_INSERT_UPDATE.
85 #
86 create table t1 (f1 int primary key, f2 longblob) row_format=redundant;
87 show create table t1;
88 Table Create Table
89 t1 CREATE TABLE `t1` (
90 `f1` int NOT NULL,
91 `f2` longblob,
92 PRIMARY KEY (`f1`)
93 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=REDUNDANT
94 start transaction;
95 insert into t1 values (1, repeat('x', 40000));
96 delete from t1 where f1 = 1;
97 SET DEBUG_SYNC = 'blob_write_middle SIGNAL do_select WAIT_FOR continue_insert';
98 insert into t1 values (1, repeat('y', 40000));;
99 SET DEBUG_SYNC = 'now WAIT_FOR do_select';
100 SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
101 begin;
102 select f2 from t1 where f1 = 1;
103 f2
104
105 commit;
106 SET DEBUG_SYNC = 'now SIGNAL continue_insert';
107 commit;
108 drop table t1;