polardbxengine/mysql-test/suite/innodb/t/zlob_long_partial_update.test

43 lines
1.5 KiB
Plaintext

--source include/have_debug.inc
--source include/have_innodb_max_16k.inc
SET @orig_log_error_verbosity= @@GLOBAL.log_error_verbosity;
SET GLOBAL log_error_verbosity=3;
set global innodb_compression_level = 0;
set debug = '+d,zlob_print_partial_update_hit';
CREATE TABLE z2 (q123 JSON) engine=innodb row_format=compressed;
set @json_doc_1 = concat('["OpenSource", "', repeat('Linux+Ubuntu+', 16000), '"]');
set @json_doc_2 = concat('["OpenSource", "', repeat('MySQL+Oracle+', 16000), '"]');
set @data_1 = repeat('Linux+Ubuntu+', 16000);
set @data_2 = repeat('MySQL+Oracle+', 16000);
--echo # Inserting...
INSERT INTO z2 VALUES ( @json_doc_1 );
--echo # Linux+Ubuntu
select strcmp(q123, @json_doc_1) = 0 as f1 from z2;
select cast(q123 as char) = @json_doc_1 as f1 from z2;
select length(q123) from z2;
select json_extract(q123, '$[1]') = @data_1 from z2;
--echo # Updating...
UPDATE z2 SET q123 = JSON_SET(q123, '$[1]', repeat('MySQL+Oracle+', 16000));
--echo # MySQL+Oracle
select strcmp(q123, @json_doc_2) = 0 as f1 from z2;
select cast(q123 as char) = @json_doc_2 from z2;
select length(q123) from z2;
select json_extract(q123, '$[1]') = @data_2 from z2;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= ZLOB partial update of field=\\(q123\\) on index=\\(\\`GEN_CLUST_INDEX\\`\\) in table=\\(test/z2\\);
--source include/search_pattern.inc
drop table z2;
set debug = '-d,lob_print_partial_update_hit';
set global innodb_compression_level = default;
SET GLOBAL log_error_verbosity= @orig_log_error_verbosity;