EVOLUTION-MANAGER
Edit File: fast_update_blobs.test
--source ../include/fast_update_gen_header.inc --let GENERATED=$MYSQL_TMP_DIR/generated_fast_update_blobs.inc --perl my $nrows = 10; open(FILE, '>', "$ENV{GENERATED}") or die; my @blob_types = ('tinyblob', 'blob', 'mediumblob', 'longblob', 'text'); foreach my $a (@blob_types) { foreach my $b (@blob_types) { foreach my $c (@blob_types) { foreach my $n ('null', 'not null') { test_blobs([$a, $b, $c], $n, $nrows); } } } } close FILE; sub test_blobs { my $cols = shift; my $n = shift; my $nrows = shift; print FILE 'create table tt (id bigint unsigned primary key,'; foreach my $i (0 .. $#{$cols}) { if ($i < $#{$cols}) { print FILE " b$i $cols->[$i] $n, "; } else { print FILE "b$i $cols->[$i] $n"; } } print FILE ") engine=tokudb;\n"; foreach my $id (1 .. $nrows) { if ($n eq 'null') { print FILE "insert into tt (id) values ($id);\n"; } else { print FILE "insert into tt values ($id,'','','');\n"; } } print FILE "create table ti like tt;\n"; print FILE "alter table ti engine=innodb;\n"; print FILE "insert into ti select * from tt;\n"; foreach my $id (1 .. $nrows) { foreach my $i (0 .. $#{$cols}) { my $long_str = rnd_str((rand(32) + 1), ("A" .. "Z", 0 .. 9)); print FILE "update tt set b$i='$long_str' where id=$id;\n"; print FILE "update ti set b$i='$long_str' where id=$id;\n"; } } print FILE '--let $diff_tables = test.tt, test.ti'."\n"; print FILE '--source include/diff_tables.inc'."\n"; print FILE 'drop table tt, ti;'; } sub rnd_str { join '', @_[ map{ rand @_ } 1 .. shift ] } EOF --source ../include/fast_update_gen_footer_silent.inc