From: Jonas Oreland Date: October 5 2011 1:39pm Subject: bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4570 to 4572) List-Archive: http://lists.mysql.com/commits/141301 Message-Id: <20111005133907.6FD7E94125E@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4572 Jonas Oreland 2011-10-05 ndb - promote well behaving tests in daily-devel to daily-basic modified: storage/ndb/test/run-test/daily-basic-tests.txt storage/ndb/test/run-test/daily-devel-tests.txt 4571 Jonas Oreland 2011-10-05 ndb - add new tools that does selects all rows from a ndb$info table added: storage/ndb/tools/ndbinfo_select_all.cpp modified: storage/ndb/tools/CMakeLists.txt storage/ndb/tools/Makefile.am 4570 jonas oreland 2011-10-04 ndb - fix spurious crash when dropping tablespace (incorrect gsn in delay) modified: storage/ndb/src/kernel/blocks/tsman.cpp === modified file 'storage/ndb/test/run-test/daily-basic-tests.txt' --- a/storage/ndb/test/run-test/daily-basic-tests.txt 2011-09-27 05:37:30 +0000 +++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2011-10-05 13:18:31 +0000 @@ -96,6 +96,10 @@ max-time: 600 cmd: atrt-testBackup args: -n Bug57650 T1 +max-time: 1000 +cmd: atrt-testBackup +args: -n BackupBank T6 + # BASIC FUNCTIONALITY max-time: 500 cmd: testBasic @@ -356,6 +360,18 @@ max-time: 300 cmd: testIndex args: -n FireTrigOverload T1 +max-time: 500 +cmd: testIndex +args: -n Bug25059 -r 3000 T1 + +max-time: 2500 +cmd: testIndex +args: -l 2 -n SR1 T6 T13 + +max-time: 2500 +cmd: testIndex +args: -l 2 -n SR1_O T6 T13 + # # SCAN TESTS # @@ -713,6 +729,10 @@ args: -n NFNR1_O T6 T13 max-time: 2500 cmd: testIndex +args: -n NFNR2 T6 T13 + +max-time: 2500 +cmd: testIndex args: -n NFNR2_O T6 T13 max-time: 2500 @@ -809,6 +829,10 @@ max-time: 500 cmd: testDict args: -n Bug54651 T1 +max-time: 1500 +cmd: testDict +args: -n CreateMaxTables T6 + # # TEST NDBAPI # @@ -1034,6 +1058,14 @@ max-time: 5000 cmd: testSystemRestart args: -n SR_UNDO T6 +max-time: 1500 +cmd: testSystemRestart +args: -n SR3 T6 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR4 T6 + # max-time: 5000 cmd: testSystemRestart @@ -1185,6 +1217,26 @@ max-time: 2500 cmd: testNodeRestart args: -n RestartRandomNodeError T6 T13 +max-time: 2500 +cmd: testNodeRestart +args: -l 1 -n MixedReadUpdateScan + +max-time: 2500 +cmd: testNodeRestart +args: -n Terror T6 T13 + +max-time: 3600 +cmd: testNodeRestart +args: -l 1 -n RestartNFDuringNR T6 T13 + +max-time: 3600 +cmd: testNodeRestart +args: -n RestartNodeDuringLCP T6 + +max-time: 2500 +cmd: testNodeRestart +args: -n FiftyPercentStopAndWait T6 T13 + # # MGMAPI AND MGSRV # @@ -1366,6 +1418,10 @@ max-time: 600 cmd: testSystemRestart args: -n Bug22696 T1 +max-time: 1000 +cmd: testSRBank +args: -n SR -l 300 -r 15 T1 + max-time: 600 cmd: testNodeRestart args: -n pnr --nologging T1 === modified file 'storage/ndb/test/run-test/daily-devel-tests.txt' --- a/storage/ndb/test/run-test/daily-devel-tests.txt 2011-06-30 15:59:25 +0000 +++ b/storage/ndb/test/run-test/daily-devel-tests.txt 2011-10-05 13:18:31 +0000 @@ -15,10 +15,6 @@ # # BACKUP # -max-time: 1000 -cmd: atrt-testBackup -args: -n BackupBank T6 - max-time: 500 cmd: testNdbApi args: -n MaxOperations T1 T6 T13 @@ -27,18 +23,6 @@ max-time: 1500 cmd: testDict args: -n CreateTableWhenDbIsFull T6 -max-time: 1500 -cmd: testDict -args: -n CreateMaxTables T6 - -max-time: 500 -cmd: testIndex -args: -n Bug25059 -r 3000 T1 - -max-time: 1000 -cmd: testSRBank -args: -n SR -l 300 -r 15 T1 - max-time: 1000 cmd: testSRBank args: -n NR -l 300 -r 15 T1 @@ -51,14 +35,6 @@ args: -n Mix -l 300 -r 15 T1 # # SYSTEM RESTARTS # -max-time: 1500 -cmd: testSystemRestart -args: -n SR3 T6 - -max-time: 1500 -cmd: testSystemRestart -args: -n SR4 T6 - # max-time: 1500 cmd: testSystemRestart @@ -73,28 +49,8 @@ args: -l 1 -n MixedPkReadPkUpdate max-time: 2500 cmd: testNodeRestart -args: -l 1 -n MixedReadUpdateScan - -max-time: 2500 -cmd: testNodeRestart -args: -n Terror T6 T13 - -max-time: 2500 -cmd: testNodeRestart args: -n FullDb T6 T13 -max-time: 3600 -cmd: testNodeRestart -args: -l 1 -n RestartNFDuringNR T6 T13 - -max-time: 3600 -cmd: testNodeRestart -args: -n RestartNodeDuringLCP T6 - -max-time: 2500 -cmd: testNodeRestart -args: -n FiftyPercentStopAndWait T6 T13 - max-time: 500 cmd: testNodeRestart args: -n Bug16772 T1 @@ -106,24 +62,12 @@ args: -n Bug16772 T1 # max-time: 2500 cmd: testIndex -args: -n NFNR2 T6 T13 - -max-time: 2500 -cmd: testIndex args: -n NFNR3 T6 T13 max-time: 2500 cmd: testIndex -args: -l 2 -n SR1 T6 T13 - -max-time: 2500 -cmd: testIndex args: -n NFNR3_O T6 T13 -max-time: 2500 -cmd: testIndex -args: -l 2 -n SR1_O T6 T13 - # dict trans max-time: 1800 cmd: testDict === modified file 'storage/ndb/tools/CMakeLists.txt' --- a/storage/ndb/tools/CMakeLists.txt 2011-07-04 13:37:56 +0000 +++ b/storage/ndb/tools/CMakeLists.txt 2011-10-05 11:21:23 +0000 @@ -91,6 +91,11 @@ ADD_EXECUTABLE(ndb_dump_frm_data ndb_dump_frm_data.cpp) TARGET_LINK_LIBRARIES(ndb_dump_frm_data ndbNDBT ndbgeneral) +MYSQL_ADD_EXECUTABLE(ndbinfo_select_all + ndbinfo_select_all.cpp + COMPONENT ClusterTools) +TARGET_LINK_LIBRARIES(ndbinfo_select_all ndbNDBT) + IF (MYSQL_VERSION_ID LESS "50501") # Don't build or install this program anymore in 5.5+ ADD_EXECUTABLE(ndb_test_platform ndb_test_platform.cpp) === modified file 'storage/ndb/tools/Makefile.am' --- a/storage/ndb/tools/Makefile.am 2011-09-02 17:24:52 +0000 +++ b/storage/ndb/tools/Makefile.am 2011-10-05 11:21:23 +0000 @@ -32,7 +32,8 @@ ndbtools_PROGRAMS = \ ndb_select_all \ ndb_select_count \ ndb_restore ndb_config \ - ndb_index_stat + ndb_index_stat \ + ndbinfo_select_all tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp \ ../test/src/NDBT_Table.cpp \ @@ -81,6 +82,7 @@ ndbinfo.sql: $(ndbinfo_sql_SOURCES) ndb_index_stat_SOURCES = ndb_index_stat.cpp $(tools_common_sources) ndb_dump_frm_data_SOURCES = ndb_dump_frm_data.cpp +ndbinfo_select_all_SOURCES = ndbinfo_select_all.cpp include $(top_srcdir)/storage/ndb/config/common.mk.am include $(top_srcdir)/storage/ndb/config/type_ndbapitools.mk.am @@ -99,4 +101,5 @@ ndb_config_LDFLAGS = @ndb_bin_am_ldflags ndbinfo_sql_LDFLAGS = @ndb_bin_am_ldflags@ ndb_index_stat_LDFLAGS = @ndb_bin_am_ldflags@ ndb_dump_frm_data_LDFLAGS = @ndb_bin_am_ldflags@ +ndbinfo_select_all_LDFLAGS = @ndb_bin_am_ldflags@ === added file 'storage/ndb/tools/ndbinfo_select_all.cpp' --- a/storage/ndb/tools/ndbinfo_select_all.cpp 1970-01-01 00:00:00 +0000 +++ b/storage/ndb/tools/ndbinfo_select_all.cpp 2011-10-05 11:21:23 +0000 @@ -0,0 +1,175 @@ +/* + Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +#include +#include + +#include +#include +#include +#include "../src/ndbapi/NdbInfo.hpp" + +const char *load_default_groups[]= { "mysql_cluster",0 }; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndbinfo_select_all"), + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + + +static void short_usage_sub(void) +{ + ndb_short_usage_sub(NULL); +} + +static void usage() +{ + ndb_usage(short_usage_sub, load_default_groups, my_long_options); +} + +int +main(int argc, char** argv) +{ + NDB_INIT(argv[0]); + ndb_opt_set_usage_funcs(short_usage_sub, usage); + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; +#ifndef DBUG_OFF + opt_debug= "d:t:O,/tmp/ndbinfo_select_all.trace"; +#endif + if ((ho_error=handle_options(&argc, &argv, my_long_options, + ndb_std_get_one_option))) + return 1; + + if (argv[0] == 0) + { + return 0; + } + + Ndb_cluster_connection con(opt_ndb_connectstring, opt_ndb_nodeid); + con.set_name("ndbinfo_select_all"); + if(con.connect(12, 5, 1) != 0) + { + ndbout << "Unable to connect to management server." << endl; + return 1; + } + + if (con.wait_until_ready(30,0) < 0) + { + ndbout << "Cluster nodes not ready in 30 seconds." << endl; + return 1; + } + + NdbInfo info(&con, ""); + if (!info.init()) + { + ndbout << "Failed to init ndbinfo!" << endl; + return 1; + } + + const Uint32 batchsizerows = 32; + + for (int ii = 0; argv[ii] != 0; ii++) + { + ndbout << "== " << argv[ii] << " ==" << endl; + + const NdbInfo::Table * pTab = 0; + int res = info.openTable(argv[ii], &pTab); + if (res != 0) + { + ndbout << "Failed to open: " << argv[ii] << ", res: " << res << endl; + continue; + } + + unsigned cols = pTab->columns(); + for (unsigned i = 0; igetColumn(i); + ndbout << pCol->m_name.c_str() << "\t"; + } + ndbout << endl; + + NdbInfoScanOperation * pScan = 0; + res= info.createScanOperation(pTab, &pScan, batchsizerows); + if (res != 0) + { + ndbout << "Failed to createScan: " << argv[ii] << ", res: " << res<< endl; + info.closeTable(pTab); + continue; + } + + if (pScan->readTuples() != 0) + { + ndbout << "scanOp->readTuples failed" << endl; + return 1; + } + + Vector recAttrs; + for (unsigned i = 0; igetValue(i); + if (pRec == 0) + { + ndbout << "Failed to getValue(" << i << ")" << endl; + return 1; + } + recAttrs.push_back(pRec); + } + + if(pScan->execute() != 0) + { + ndbout << "scanOp->execute failed" << endl; + return 1; + } + + while(pScan->nextResult() == 1) + { + for (unsigned i = 0; iisNULL()) + { + ndbout << "NULL"; + } + else + { + switch(pTab->getColumn(i)->m_type){ + case NdbInfo::Column::String: + ndbout << recAttrs[i]->c_str(); + break; + case NdbInfo::Column::Number: + ndbout << recAttrs[i]->u_32_value(); + break; + case NdbInfo::Column::Number64: + ndbout << recAttrs[i]->u_64_value(); + break; + } + } + ndbout << "\t"; + } + ndbout << endl; + } + + info.releaseScanOperation(pScan); + info.closeTable(pTab); + } + + return 0; +} + +template class Vector; No bundle (reason: useless for push emails).