Debian Codegraph @

mysql-test/suite/innodb/t/lob_partial_update.test

raw
1 --source include/have_debug.inc
2 --source include/have_innodb_max_16k.inc
3
4 SET @orig_log_error_verbosity= @@GLOBAL.log_error_verbosity;
5 SET GLOBAL log_error_verbosity=3;
6
7 set global innodb_compression_level = 0;
8 set debug = '+d,lob_print_partial_update_hit';
9
10 CREATE TABLE t(j1 JSON);
11
12 set @data_1 = repeat('abcdefghijklmnopqrstuvwxyz1234', 6006);
13 set @json_doc_1 = concat('["Sven", "', @data_1, '"]');
14
15 INSERT INTO t VALUES (@json_doc_1);
16
17 start transaction;
18 --echo # Sven
19 select json_extract(j1, '$[0]') from t;
20 UPDATE t SET j1 = JSON_SET(j1, '$[0]', 'Knut');
21 --echo # Knut
22 select json_extract(j1, '$[0]') from t;
23 savepoint a;
24 UPDATE t SET j1 = JSON_SET(j1, '$[0]', 'Anna');
25 --echo # Anna
26 select json_extract(j1, '$[0]') from t;
27
28 rollback to a;
29 --echo # Knut
30 select json_extract(j1, '$[0]') from t;
31
32 commit;
33 --echo # Knut
34 select json_extract(j1, '$[0]') from t;
35
36 let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
37 let SEARCH_PATTERN= LOB partial update of field=\\(j1\\) on index=\\(\\`GEN_CLUST_INDEX\\`\\) in table=\\(test/t\\);
38 --source include/search_pattern.inc
39
40 drop table t;
41 set debug = '-d,lob_print_partial_update_hit';
42
43 set debug = '+d,zlob_print_partial_update_hit';
44
45 CREATE TABLE t2(j1 JSON) row_format=compressed;
46
47 INSERT INTO t2 VALUES (@json_doc_1);
48
49 start transaction;
50 --echo # Sven
51 select json_extract(j1, '$[0]') from t2;
52 UPDATE t2 SET j1 = JSON_SET(j1, '$[0]', 'Knut');
53 --echo # Knut
54 select json_extract(j1, '$[0]') from t2;
55 savepoint a;
56 UPDATE t2 SET j1 = JSON_SET(j1, '$[0]', 'Anna');
57 --echo # Anna
58 select json_extract(j1, '$[0]') from t2;
59
60 rollback to a;
61 --echo # Knut
62 select json_extract(j1, '$[0]') from t2;
63
64 commit;
65 --echo # Knut
66 select json_extract(j1, '$[0]') from t2;
67
68 let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
69 let SEARCH_PATTERN= ZLOB partial update of field=\\(j1\\) on index=\\(\\`GEN_CLUST_INDEX\\`\\) in table=\\(test/t2\\);
70 --source include/search_pattern.inc
71
72 drop table t2;
73 set debug = '-d,zlob_print_partial_update_hit';
74 set global innodb_compression_level = default;
75 SET GLOBAL log_error_verbosity= @orig_log_error_verbosity;