config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/ndb/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/suite/ndb/t/ndb_mgm.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

# No need to run this test with embedded sinced
# nothing (except .result output) differs
-- source include/not_embedded.inc

# Build the standard command used for running "ndb_mgm"
let $mgm_cmd = $NDB_MGM;
let $mgm_cmd = $mgm_cmd --no-defaults;
let $mgm_cmd = $mgm_cmd --ndb-connectstring="$NDB_CONNECTSTRING";
let $mgm_cmd = $mgm_cmd --verbose=0;

#
# Build strings for masking ndb_mgm output
#

#echo MYSQL_SERVER_VERSION: $MYSQL_SERVER_VERSION;

# extract X.X.X for MySQL
let $mysql_version=
  `select SUBSTRING_INDEX('$MYSQL_SERVER_VERSION','-', 1)`;
# Remove any trailing a in the X.X.X string(ugly but works)
let $mysql_version=
  `select TRIM(TRAILING 'a' FROM '$mysql_version')`;
let $mysql_version = mysql-$mysql_version;
# echo mysql_version: $mysql_version;

# load ndb-X.X.X from the "ndb_version_string" vaioable
let $ndb_version=
  `select VARIABLE_VALUE
     from INFORMATION_SCHEMA.GLOBAL_VARIABLES
       where VARIABLE_NAME='ndb_version_string'`;
# echo ndb_version: $ndb_version;

#
# Test the SHOW command
#  - make output stable by using a temporary
#    table for the output
#
--disable_query_log
let $dump_file = $MYSQLTEST_VARDIR/tmp/ndb_mgm_show.txt;

# Dump the output of ndb_mgm to file
exec $mgm_cmd -e "show" > $dump_file;

# Load the file into a temporary table
CREATE TEMPORARY TABLE ndb_mgm_show (a varchar(512)) ENGINE = HEAP;

# needed for embedded
--chmod 0777 $dump_file
eval LOAD DATA INFILE '$dump_file' INTO TABLE ndb_mgm_show
  FIELDS TERMINATED BY '\n';
--remove_file $dump_file

# Remove Windows line feeds
UPDATE ndb_mgm_show SET a = TRIM(TRAILING "\r" FROM a);

# Show the two data nodes
--replace_result $mysql_version MYSQL_VERSION $ndb_version NDB_VERSION
SELECT a as 'ndbd(s)' FROM ndb_mgm_show
  WHERE SUBSTR(a, 4, 3) IN (1, 2);

# Show the mgm node
--replace_result $mysql_version MYSQL_VERSION $ndb_version NDB_VERSION
SELECT a as 'ndb_mgmd(s)' FROM ndb_mgm_show
  WHERE SUBSTR(a, 4, 3) IN (3);

# Show the two mysqld nodes which are using three nodeids each
# as well as the 8 free slots, mask out the nodeid since those are
# not deterministic, order the connected nodes first
--replace_regex /id=[0-9]+/id=X/
--replace_result $mysql_version MYSQL_VERSION $ndb_version NDB_VERSION
SELECT a as 'mysqld(s)' FROM ndb_mgm_show
  WHERE SUBSTR(a, 4, 3)
    IN (16,32,48,49,63,127,192,228,229,230,231,232,233,255)
      ORDER BY LOCATE("accepting", a);

DROP TABLE ndb_mgm_show;
--enable_query_log

echo ; # newline for nicer .result file

#
# Test the [ALL|<nodeid>] REPORT [MEMORYUSAGE|BACKUPSTATUS]
#
echo Missing report type specifier;
--error 255
exec $mgm_cmd -e "ALL REPORT  ";

echo Unknown report type specifier;
--error 255
exec $mgm_cmd -e "ALL REPORT something";

echo ALL REPORT MEMORYUSAGE;
--replace_regex /[0-9]+\%\([0-9]+ [0-9]+K pages of total [0-9]+/X%(X XK pages of total X/
exec $mgm_cmd -e "ALL REPORT MEMORYUSAGE";

echo 1 REPORT MEMORYUSAGE;
--replace_regex /[0-9]+\%\([0-9]+ [0-9]+K pages of total [0-9]+/X%(X XK pages of total X/
exec $mgm_cmd -e "1 REPORT  MEMORYUSAGE";

echo 2 REPORT MEMORYUSAGE;
--replace_regex /[0-9]+\%\([0-9]+ [0-9]+K pages of total [0-9]+/X%(X XK pages of total X/
exec $mgm_cmd -e "2  REPORT MEMORYUSAGE";

echo Testing abbreviated form;
--replace_regex /[0-9]+\%\([0-9]+ [0-9]+K pages of total [0-9]+/X%(X XK pages of total X/
exec $mgm_cmd -e "2    REPORT Mem";

echo Request memoryusage from non NDB node 3;
--error 255
exec $mgm_cmd -e "3 REPORT MEMORYUSAGE";

echo Request memoryusage from non existing node 17;
--error 255
exec $mgm_cmd -e "17 REPORT MEMORYUSAGE";

echo Request memoryusage from illegal nodeid 49;
--error 255
exec $mgm_cmd -e "49 REPORT MEMORYUSAGE";

--echo For the following, we want to be running ndbmtd with multiple
--echo LQH threads
--echo NDBD (1 instance) is ok, but 2 instances indicates ndbmtd
--echo with proxy and only 1 real instance, not interesting.
--echo cnf file should make this impossible

--echo Following query should have no results
select   node_id, count(1) as instances 
  from   ndbinfo.threadblocks 
 where   block_name="BACKUP" 
group by node_id 
having   instances=2;

echo ALL REPORT BACKUPSTATUS;
exec $mgm_cmd -e "ALL REPORT BACKUPSTATUS";

echo 1 REPORT BACKUPSTATUS;
exec $mgm_cmd -e "1 REPORT    BACKUPSTATUS";

echo 2 REPORT BACKUPSTATUS;
exec $mgm_cmd -e "2 REPORT BACKUPSTATUS";

echo Testing HELP for REPORT;
exec $mgm_cmd -e "HELP REPORT";

#
# Test <ALL|nodeid> DUMP <arg>[ <argN>]
#
echo Missing dump arg;
--error 255
exec $mgm_cmd -e "ALL DUMP  ";

echo Illegal argument 4294967300;
--error 255
exec $mgm_cmd -e "1 DUMP 4294967300";

echo Illegal argument -1;
--error 255
exec $mgm_cmd -e "1 DUMP -1";

echo Robustness issue with bug#14537622;
echo Data node must not crash here;
exec $mgm_cmd -e "ALL DUMP 1000 1000";

echo ALL DUMP 1;
exec $mgm_cmd -e "ALL DUMP 1 ";

echo 1 DUMP 1 2;
exec $mgm_cmd -e "1 DUMP 1 2";

echo max DUMP args;
exec $mgm_cmd -e "1 DUMP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25";

echo more than max DUMP args;
--error 255
exec $mgm_cmd -e "1 DUMP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26";

--echo test all report eventlog
--echo note: test within quotes...
--exec $mgm_cmd -e "1 report eventlog" >> $NDB_TOOLS_OUTPUT
--exec $mgm_cmd -e "2 report eventlog" >> $NDB_TOOLS_OUTPUT
--exec $mgm_cmd -e "all report eventlog" >> $NDB_TOOLS_OUTPUT

#
# Test CLUSTERLOG command
#
echo Missing argument;
--error 255
exec $mgm_cmd -e "CLUSTERLOG";

echo # Unknown argument;
--error 255
exec $mgm_cmd -e "CLUSTERLOG unknown_argument";

echo # CLUSTERLOG INFO;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # CLUSTERLOG OFF;
exec $mgm_cmd -e "CLUSTERLOG OFF";

echo # Should be OFF now;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # CLUSTERLOG ON;
exec $mgm_cmd -e "CLUSTERLOG ON";

echo # Should be ON now;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # CLUSTERLOG TOGGLE;
exec $mgm_cmd -e "CLUSTERLOG TOGGLE";

echo # Should be OFF now;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # CLUSTERLOG TOGGLE;
exec $mgm_cmd -e "CLUSTERLOG TOGGLE";

echo # Should be ON now;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # Turn off severity INFO, ERROR and ALERT;
exec $mgm_cmd -e "CLUSTERLOG FILTER ALERT INFO ERROR";

echo # Should not list ALERT, INFO or ERROR;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # Turn off reaining severities;
exec $mgm_cmd -e "CLUSTERLOG FILTER WARNING CRITICAL";

echo # Should not list anything;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # Back to default severity;
exec $mgm_cmd -e "CLUSTERLOG FILTER WARNING CRITICAL ALERT INFO ERROR";

echo # Should list default;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # Bogus severity;
--error 255
exec $mgm_cmd -e "CLUSTERLOG FILTER bogus1";

echo # Should list default;
exec $mgm_cmd -e "CLUSTERLOG INFO";

echo # Bug 11752837: start backup wait started should not print completion logs;
exec $mgm_cmd -e "START BACKUP WAIT STARTED";

echo # Bug 16585455: start backup with backup ID out of range;
--error 255
exec $mgm_cmd -e "START BACKUP 201303271430 WAIT COMPLETED";

echo # Test 1/2 for Bug#16585497: abort backup with backup ID > 2^31;
exec $mgm_cmd -e "ABORT BACKUP 2147483648";

echo # Test 2/2 for Bug#16585497: abort backup with backup ID out of range;
--error 255
exec $mgm_cmd -e "ABORT BACKUP 1000000000000000000";


Man Man