403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.208.163
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/ndb/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb/t/ndb_optimize_table.test
# The include statement below is a temp one for tests that are yet to
#be ported to run with InnoDB,
#but needs to be kept for tests that would need MyISAM in future.
--source include/force_myisam_default.inc

-- source include/have_ndb.inc
-- source include/not_embedded.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

set @val = "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF";
set @val2 = 0x0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF;


CREATE TABLE t1 (
  pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  attr1 VARCHAR(1024),
  attr2 VARBINARY(1024),
  attr3 TEXT
) ROW_FORMAT=DYNAMIC ENGINE=ndbcluster;

CREATE UNIQUE INDEX ui on t1(pk,attr1,attr2);

#
# insert records into table
#
set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
set ndb_autoincrement_prefetch_sz = 256;
let $1=1000;
disable_query_log;
while ($1)
{
  eval insert into t1(attr1, attr2, attr3) values (@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val),(@val, @val2, @val);
  dec $1;
}
enable_query_log;
set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
select count(*) from t1;

flush tables;
select data_length from information_schema.tables where table_name like 't1' into @data_length0;

#
# delete some rows
#
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
delete from t1 where mod(pk, 100) < 75 order by pk limit 1000;
select count(*) from t1;
select count(*) from t1 where mod(pk, 100) < 75;

flush tables;
select data_length from information_schema.tables where table_name like 't1' into @data_length;

set ndb_optimization_delay = 0;
optimize table t1;

flush tables;
select data_length from information_schema.tables where table_name like 't1' into @data_length2;

select 100*(@data_length-@data_length2)/@data_length into @opt_level;

#select @data_length0, @data_length,@data_length2,@opt_level;
select @opt_level > 30;

drop table t1;

Youez - 2016 - github.com/yon3zu
LinuXploit