mariadb/storage/ndb/test/include/HugoOperations.hpp

135 lines
3.7 KiB
C++
Raw Normal View History

/* Copyright (C) 2003 MySQL AB
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; either version 2 of the License, or
(at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef HUGO_OPERATIONS_HPP
#define HUGO_OPERATIONS_HPP
#include <NDBT.hpp>
#include <HugoCalculator.hpp>
#include <UtilTransactions.hpp>
#include <Vector.hpp>
class HugoOperations : public UtilTransactions {
public:
HugoOperations(const NdbDictionary::Table&,
const NdbDictionary::Index* idx = 0);
~HugoOperations();
int startTransaction(Ndb*);
ndb-wl2325.patch storage/ndb/include/debugger/EventLogger.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/GlobalSignalNumbers.h: Import patch ndb-wl2325.patch storage/ndb/include/kernel/NodeInfo.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/signaldata/AlterTab.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/signaldata/CreateEvnt.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/signaldata/CreateTab.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/signaldata/DropTab.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/signaldata/EventReport.hpp: Import patch ndb-wl2325.patch storage/ndb/include/kernel/signaldata/SumaImpl.hpp: Import patch ndb-wl2325.patch storage/ndb/include/mgmapi/mgmapi.h: Import patch ndb-wl2325.patch storage/ndb/include/mgmapi/mgmapi_config_parameters.h: Import patch ndb-wl2325.patch storage/ndb/include/mgmapi/ndb_logevent.h: Import patch ndb-wl2325.patch storage/ndb/include/ndbapi/Ndb.hpp: Import patch ndb-wl2325.patch storage/ndb/include/ndbapi/NdbDictionary.hpp: Import patch ndb-wl2325.patch storage/ndb/include/ndbapi/NdbError.hpp: Import patch ndb-wl2325.patch storage/ndb/include/ndbapi/NdbEventOperation.hpp: Import patch ndb-wl2325.patch storage/ndb/include/ndbapi/ndb_cluster_connection.hpp: Import patch ndb-wl2325.patch storage/ndb/include/ndbapi/ndberror.h: Import patch ndb-wl2325.patch storage/ndb/ndbapi-examples/Makefile: Import patch ndb-wl2325.patch storage/ndb/src/common/debugger/EventLogger.cpp: Import patch ndb-wl2325.patch storage/ndb/src/common/debugger/Makefile.am: Import patch ndb-wl2325.patch storage/ndb/src/common/debugger/signaldata/SignalNames.cpp: Import patch ndb-wl2325.patch storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp: Import patch ndb-wl2325.patch storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/SimBlockList.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/suma/Suma.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/suma/Suma.hpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/suma/SumaInit.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/trix/Trix.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/blocks/trix/Trix.hpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/vm/Configuration.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/vm/SimulatedBlock.cpp: Import patch ndb-wl2325.patch storage/ndb/src/kernel/vm/SimulatedBlock.hpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmapi/mgmapi.cpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmapi/ndb_logevent.cpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmclient/CommandInterpreter.cpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmsrv/MgmtSrvr.hpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmsrv/Services.cpp: Import patch ndb-wl2325.patch storage/ndb/src/mgmsrv/Services.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/ClusterMgr.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/ClusterMgr.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/Ndb.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbDictionary.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbEventOperation.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbImpl.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/NdbWaiter.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/Ndberr.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/Ndbif.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/Ndbinit.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/ObjectMap.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/TransporterFacade.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/TransporterFacade.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp: Import patch ndb-wl2325.patch storage/ndb/src/ndbapi/ndberror.c: Import patch ndb-wl2325.patch storage/ndb/test/include/HugoOperations.hpp: Import patch ndb-wl2325.patch storage/ndb/test/include/HugoTransactions.hpp: Import patch ndb-wl2325.patch storage/ndb/test/include/NDBT_Table.hpp: Import patch ndb-wl2325.patch storage/ndb/test/include/NDBT_Test.hpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/Makefile.am: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/Bank.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/Bank.hpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/bankCreator.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/bankMakeGL.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/bankSumAccounts.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/bankTimer.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/bankTransactionMaker.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bank/testBank.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bench/asyncGenerator.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/bench/ndb_schema.hpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/test_event.cpp: Import patch ndb-wl2325.patch storage/ndb/test/ndbapi/test_event_multi_table.cpp: Import patch ndb-wl2325.patch storage/ndb/test/run-test/Makefile.am: Import patch ndb-wl2325.patch storage/ndb/test/run-test/daily-devel-tests.txt: Import patch ndb-wl2325.patch storage/ndb/test/src/HugoOperations.cpp: Import patch ndb-wl2325.patch storage/ndb/test/src/HugoTransactions.cpp: Import patch ndb-wl2325.patch storage/ndb/test/src/NDBT_ResultRow.cpp: Import patch ndb-wl2325.patch storage/ndb/test/src/NDBT_Tables.cpp: Import patch ndb-wl2325.patch storage/ndb/test/src/NDBT_Test.cpp: Import patch ndb-wl2325.patch storage/ndb/test/src/UtilTransactions.cpp: Import patch ndb-wl2325.patch storage/ndb/test/tools/Makefile.am: Import patch ndb-wl2325.patch
2005-09-15 11:33:50 +02:00
int setTransaction(NdbTransaction*,bool not_null_ok= false);
int closeTransaction(Ndb*);
wl2240 - ndb - new testcase for validating startTransation with hint ndb/include/ndbapi/NdbDictionary.hpp: NdbDictionaryColumn::getSizeInBytes ndb/include/ndbapi/NdbOperation.hpp: NdbOperation::getTable ndb/include/ndbapi/NdbTransaction.hpp: Make getConnectionNodeId public (for test programs) ndb/include/util/Base64.hpp: base64(void*) ndb/src/common/util/Base64.cpp: base64(void*) ndb/src/kernel/blocks/ERROR_codes.txt: New error code for REF'ing non-local TCKEYREQ ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Easy clearing of ERROR_INSERT ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: New error code for REF'ing non-local TCKEYREQ ndb/src/ndbapi/NdbDictionary.cpp: NdbDictionaryColumn::getSizeInBytes ndb/src/ndbapi/NdbDictionaryImpl.cpp: If m_noIfDistKyes == 0, then each PK is dist key ndb/src/ndbapi/NdbOperation.cpp: NdbOperation::getTable ndb/src/ndbapi/NdbOperationSearch.cpp: remove d-key handling for pk ops ndb/test/include/HugoCalculator.hpp: remove unimpletemented methods ndb/test/include/HugoOperations.hpp: 1) HugoOperation::setTransaction 2) Type independant value handling 3) Some more util methods ndb/test/ndbapi/testPartitioning.cpp: new testcase for validating startTransation with hint ndb/test/run-test/atrt-mysql-test-run: fix checks of return values ndb/test/src/HugoCalculator.cpp: Better generation of values -- depends on fact that srand(K), rand() == srand(K), rand() Generate string with base64 ndb/test/src/HugoOperations.cpp: 1) HugoOperation::setTransaction 2) Type independant value handling 3) Some more util methods
2005-01-14 08:58:50 +01:00
NdbTransaction* getTransaction();
void refresh();
void setTransactionId(Uint64);
int pkInsertRecord(Ndb*,
int recordNo,
int numRecords = 1,
int updatesValue = 0);
int pkWriteRecord(Ndb*,
int recordNo,
int numRecords = 1,
int updatesValue = 0);
int pkWritePartialRecord(Ndb*,
int recordNo,
int numRecords = 1);
int pkReadRecord(Ndb*,
int recordNo,
int numRecords = 1,
NdbOperation::LockMode lm = NdbOperation::LM_Read);
int pkUpdateRecord(Ndb*,
int recordNo,
int numRecords = 1,
int updatesValue = 0);
int pkDeleteRecord(Ndb*,
int recordNo,
int numRecords = 1);
int execute_Commit(Ndb*,
AbortOption ao = AbortOnError);
int execute_NoCommit(Ndb*,
AbortOption ao = AbortOnError);
int execute_Rollback(Ndb*);
int saveCopyOfRecord(int numRecords = 1);
int compareRecordToCopy(int numRecords = 1);
BaseString getRecordStr(int recordNum);
int getRecordGci(int recordNum);
int setValueForAttr(NdbOperation*,
int attrId,
int rowId,
int updateId);
wl2240 - ndb - new testcase for validating startTransation with hint ndb/include/ndbapi/NdbDictionary.hpp: NdbDictionaryColumn::getSizeInBytes ndb/include/ndbapi/NdbOperation.hpp: NdbOperation::getTable ndb/include/ndbapi/NdbTransaction.hpp: Make getConnectionNodeId public (for test programs) ndb/include/util/Base64.hpp: base64(void*) ndb/src/common/util/Base64.cpp: base64(void*) ndb/src/kernel/blocks/ERROR_codes.txt: New error code for REF'ing non-local TCKEYREQ ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Easy clearing of ERROR_INSERT ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: New error code for REF'ing non-local TCKEYREQ ndb/src/ndbapi/NdbDictionary.cpp: NdbDictionaryColumn::getSizeInBytes ndb/src/ndbapi/NdbDictionaryImpl.cpp: If m_noIfDistKyes == 0, then each PK is dist key ndb/src/ndbapi/NdbOperation.cpp: NdbOperation::getTable ndb/src/ndbapi/NdbOperationSearch.cpp: remove d-key handling for pk ops ndb/test/include/HugoCalculator.hpp: remove unimpletemented methods ndb/test/include/HugoOperations.hpp: 1) HugoOperation::setTransaction 2) Type independant value handling 3) Some more util methods ndb/test/ndbapi/testPartitioning.cpp: new testcase for validating startTransation with hint ndb/test/run-test/atrt-mysql-test-run: fix checks of return values ndb/test/src/HugoCalculator.cpp: Better generation of values -- depends on fact that srand(K), rand() == srand(K), rand() Generate string with base64 ndb/test/src/HugoOperations.cpp: 1) HugoOperation::setTransaction 2) Type independant value handling 3) Some more util methods
2005-01-14 08:58:50 +01:00
int equalForAttr(NdbOperation*,
int attrId,
int rowId);
wl2240 - ndb - new testcase for validating startTransation with hint ndb/include/ndbapi/NdbDictionary.hpp: NdbDictionaryColumn::getSizeInBytes ndb/include/ndbapi/NdbOperation.hpp: NdbOperation::getTable ndb/include/ndbapi/NdbTransaction.hpp: Make getConnectionNodeId public (for test programs) ndb/include/util/Base64.hpp: base64(void*) ndb/src/common/util/Base64.cpp: base64(void*) ndb/src/kernel/blocks/ERROR_codes.txt: New error code for REF'ing non-local TCKEYREQ ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Easy clearing of ERROR_INSERT ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: New error code for REF'ing non-local TCKEYREQ ndb/src/ndbapi/NdbDictionary.cpp: NdbDictionaryColumn::getSizeInBytes ndb/src/ndbapi/NdbDictionaryImpl.cpp: If m_noIfDistKyes == 0, then each PK is dist key ndb/src/ndbapi/NdbOperation.cpp: NdbOperation::getTable ndb/src/ndbapi/NdbOperationSearch.cpp: remove d-key handling for pk ops ndb/test/include/HugoCalculator.hpp: remove unimpletemented methods ndb/test/include/HugoOperations.hpp: 1) HugoOperation::setTransaction 2) Type independant value handling 3) Some more util methods ndb/test/ndbapi/testPartitioning.cpp: new testcase for validating startTransation with hint ndb/test/run-test/atrt-mysql-test-run: fix checks of return values ndb/test/src/HugoCalculator.cpp: Better generation of values -- depends on fact that srand(K), rand() == srand(K), rand() Generate string with base64 ndb/test/src/HugoOperations.cpp: 1) HugoOperation::setTransaction 2) Type independant value handling 3) Some more util methods
2005-01-14 08:58:50 +01:00
int setValues(NdbOperation*, int rowId, int updateId);
int verifyUpdatesValue(int updatesValue, int _numRows = 0);
int indexReadRecords(Ndb*, const char * idxName, int recordNo,
bool exclusive = false,
int records = 1);
int indexUpdateRecord(Ndb*,
const char * idxName,
int recordNo,
int numRecords = 1,
int updatesValue = 0);
int scanReadRecords(Ndb*, NdbScanOperation::LockMode =
NdbScanOperation::LM_CommittedRead,
int numRecords = 1);
NdbIndexScanOperation* pIndexScanOp;
NDBT_ResultRow& get_row(Uint32 idx) { return *rows[idx];}
2005-07-21 09:10:44 +02:00
int execute_async(Ndb*, NdbTransaction::ExecType, NdbTransaction::AbortOption = NdbTransaction::AbortOnError);
int execute_async_prepare(Ndb*, NdbTransaction::ExecType, NdbTransaction::AbortOption = NdbTransaction::AbortOnError);
int wait_async(Ndb*, int timeout = -1);
protected:
void allocRows(int rows);
void deallocRows();
Vector<NDBT_ResultRow*> rows;
HugoCalculator calc;
Vector<BaseString> savedRecords;
wl2126 - ndb - fix last unhandled part of read_multi_range reading sorted multi_range with several range-scans BitKeeper/deleted/.del-NdbResultSet.hpp~e0042f4c18088ff6: Delete: ndb/include/ndbapi/NdbResultSet.hpp BitKeeper/deleted/.del-NdbResultSet.cpp~84d192cf3f42600d: Delete: ndb/src/ndbapi/NdbResultSet.cpp ndb/include/ndbapi/NdbApi.hpp: Remove NdbResultSet ndb/include/ndbapi/NdbIndexScanOperation.hpp: Remove NdbResultSet ndb/include/ndbapi/NdbScanOperation.hpp: Remove NdbResultSet ndb/src/ndbapi/Makefile.am: Remove NdbResultSet ndb/src/ndbapi/NdbConnection.cpp: Remove NdbResultSet ndb/src/ndbapi/NdbIndexOperation.cpp: Remove NdbResultSet ndb/src/ndbapi/NdbScanOperation.cpp: Remove NdbResultSet ndb/test/include/HugoOperations.hpp: Remove NdbResultSet ndb/test/ndbapi/ScanFunctions.hpp: Remove NdbResultSet ndb/test/ndbapi/ScanInterpretTest.hpp: Remove NdbResultSet ndb/test/ndbapi/bank/Bank.cpp: Remove NdbResultSet ndb/test/ndbapi/bank/BankLoad.cpp: Remove NdbResultSet ndb/test/ndbapi/slow_select.cpp: Remove NdbResultSet ndb/test/ndbapi/testBlobs.cpp: Remove NdbResultSet ndb/test/ndbapi/testDataBuffers.cpp: Remove NdbResultSet ndb/test/ndbapi/testDeadlock.cpp: Remove NdbResultSet ndb/test/ndbapi/testIndex.cpp: Remove NdbResultSet ndb/test/ndbapi/testOIBasic.cpp: Remove NdbResultSet ndb/test/ndbapi/testReadPerf.cpp: Remove NdbResultSet ndb/test/ndbapi/testScan.cpp: Remove NdbResultSet ndb/test/ndbapi/testScanPerf.cpp: Remove NdbResultSet ndb/test/src/HugoOperations.cpp: Remove NdbResultSet ndb/test/src/HugoTransactions.cpp: Remove NdbResultSet ndb/test/src/UtilTransactions.cpp: Remove NdbResultSet ndb/tools/delete_all.cpp: Remove NdbResultSet ndb/tools/select_all.cpp: Remove NdbResultSet ndb/tools/select_count.cpp: Remove NdbResultSet sql/ha_ndbcluster.cc: 1) Fix a = 3 -> a= 3 2) Impl. last part of wl2126 ordered "multi ordered scan"
2004-12-07 15:15:49 +01:00
struct RsPair { NdbScanOperation* m_result_set; int records; };
Vector<RsPair> m_result_sets;
Vector<RsPair> m_executed_result_sets;
int m_async_reply;
int m_async_return;
2005-07-21 09:10:44 +02:00
friend void HugoOperations_async_callback(int, NdbTransaction*, void*);
void callback(int res, NdbTransaction*);
};
#endif