diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-06-07 17:31:32 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-06-07 17:31:32 +0000 |
commit | dfa8ee365f677449a1f9e6f6ec2d42b973081916 (patch) | |
tree | 165fe5548627081d1b00d52cee447bfb4cf31e12 /ndb/test/src | |
parent | 7942677020d36bd5baafd8d765968921f348cdc2 (diff) | |
download | mariadb-git-dfa8ee365f677449a1f9e6f6ec2d42b973081916.tar.gz |
ndb source tree cleanup, see respective file
BitKeeper/deleted/.del-BinDist.sh~8ea6fee0be3de36:
Delete: ndb/old_files/BinDist.sh
BitKeeper/deleted/.del-Defs.mk~fab44ad996ed5499:
Delete: ndb/old_files/Defs.mk
BitKeeper/deleted/.del-Makefile~726e96331d4343ce:
Delete: ndb/old_files/Makefile
BitKeeper/deleted/.del-SrcDist.sh~ad4f1cd7aae4265b:
Delete: ndb/old_files/SrcDist.sh
BitKeeper/deleted/.del-configure~501239931f8bb1:
Delete: ndb/old_files/configure
BitKeeper/deleted/.del-Epilogue.mk~60f7edf886726154:
Delete: ndb/old_files/Epilogue.mk
BitKeeper/deleted/.del-README~b619a580720ec3d8:
Delete: ndb/old_files/README
BitKeeper/deleted/.del-env.sh~91075f1664ce8292:
Delete: ndb/old_files/env.sh
BitKeeper/deleted/.del-mysqlclusterenv.sh~f0d8a63e844255f5:
Delete: ndb/old_files/mysqlclusterenv.sh
BitKeeper/deleted/.del-Defs.DEBUG.mk~8ed7bb195181c74a:
Delete: ndb/config/old_files/Defs.DEBUG.mk
BitKeeper/deleted/.del-acinclude.m4~b1472f9faac0c71:
Delete: ndb/config/old_files/acinclude.m4
BitKeeper/deleted/.del-Defs.HPUX.HPPA.GCC.mk~b50ab324c3ce07ce:
Delete: ndb/config/old_files/Defs.HPUX.HPPA.GCC.mk
BitKeeper/deleted/.del-Defs.IBMAIX.POWERPC.GCC.mk~76bea6928ca7b8f0:
Delete: ndb/config/old_files/Defs.IBMAIX.POWERPC.GCC.mk
BitKeeper/deleted/.del-Defs.LINUX.x86.GCC.mk~15f3c82665d141a0:
Delete: ndb/config/old_files/Defs.LINUX.x86.GCC.mk
BitKeeper/deleted/.del-Defs.LINUX.x86.ICC.mk~e51a6e19daeb353:
Delete: ndb/config/old_files/Defs.LINUX.x86.ICC.mk
BitKeeper/deleted/.del-Defs.LINUX.x86_64.GCC.mk~9e853e7e1142b2d7:
Delete: ndb/config/old_files/Defs.LINUX.x86_64.GCC.mk
BitKeeper/deleted/.del-Defs.MACOSX.POWERPC.GCC.mk~d661574b758ac911:
Delete: ndb/config/old_files/Defs.MACOSX.POWERPC.GCC.mk
BitKeeper/deleted/.del-Defs.OSE.PPC750.DIAB.mk~d5d7116c512290bc:
Delete: ndb/config/old_files/Defs.OSE.PPC750.DIAB.mk
BitKeeper/deleted/.del-Defs.RELEASE.mk~6c195617d8e1c8ec:
Delete: ndb/config/old_files/Defs.RELEASE.mk
BitKeeper/deleted/.del-Defs.RELEASE_TRACE.mk~e367d147bd3ad0bf:
Delete: ndb/config/old_files/Defs.RELEASE_TRACE.mk
BitKeeper/deleted/.del-Defs.SIMCELLO.SOFTOSE.GCC.mk~5acee8046e3dfd21:
Delete: ndb/config/old_files/Defs.SIMCELLO.SOFTOSE.GCC.mk
BitKeeper/deleted/.del-Defs.WIN32.x86.VC7.mk~582038c28dd89391:
Delete: ndb/config/old_files/Defs.WIN32.x86.VC7.mk
BitKeeper/deleted/.del-Defs.SOFTOSE.SPARC.GCC.mk~ebd0c4aab56c1202:
Delete: ndb/config/old_files/Defs.SOFTOSE.SPARC.GCC.mk
BitKeeper/deleted/.del-Defs.SOLARIS.SPARC.FORTE6.mk~4367e18b8246761e:
Delete: ndb/config/old_files/Defs.SOLARIS.SPARC.FORTE6.mk
BitKeeper/deleted/.del-Defs.SOLARIS.SPARC.GCC.mk~d781a20b8235525c:
Delete: ndb/config/old_files/Defs.SOLARIS.SPARC.GCC.mk
BitKeeper/deleted/.del-Defs.SOLARIS.SPARC_64.GCC.mk~76626f56dcd0e8e9:
Delete: ndb/config/old_files/Defs.SOLARIS.SPARC_64.GCC.mk
BitKeeper/deleted/.del-Defs.SOLARIS6.SPARC.GCC.mk~2b05903f79ce771:
Delete: ndb/config/old_files/Defs.SOLARIS6.SPARC.GCC.mk
BitKeeper/deleted/.del-Defs.TRU64X.ALPHA.GCC.mk~6ba3fc0cfaa37cb2:
Delete: ndb/config/old_files/Defs.TRU64X.ALPHA.GCC.mk
BitKeeper/deleted/.del-GuessConfig.sh~ebdb504ed6b7ab68:
Delete: ndb/config/old_files/GuessConfig.sh
BitKeeper/deleted/.del-Makefile.am~c28d15539f926269:
Delete: ndb/config/old_files/Makefile.am
BitKeeper/deleted/.del-configure.in~3e0ef32c155b79bc:
Delete: ndb/config/old_files/configure.in
BitKeeper/deleted/.del-config.h.in~b9209994763e30f8:
Delete: ndb/config/old_files/config.h.in
BitKeeper/deleted/.del-Makefile~71ad5c694da8711:
Delete: ndb/src/old_files/Makefile
BitKeeper/deleted/.del-Makefile~261cfb7897aa2259:
Delete: ndb/test/newtonapi/Makefile
BitKeeper/deleted/.del-Makefile~d46bb4a49ae611f9:
Delete: ndb/test/odbc/Makefile
BitKeeper/deleted/.del-Makefile_old~5ce89facf68772b:
Delete: ndb/test/Makefile_old
ndb/test/include/NdbSchemaCon.hpp:
Rename: ndb/include/ndbapi/NdbSchemaCon.hpp -> ndb/test/include/NdbSchemaCon.hpp
ndb/test/include/NdbSchemaOp.hpp:
Rename: ndb/include/ndbapi/NdbSchemaOp.hpp -> ndb/test/include/NdbSchemaOp.hpp
ndb/include/Makefile.am:
removed NdbSchema from ndbapi
ndb/include/ndbapi/NdbDictionary.hpp:
added Column::getSize()
and print function for Column::Type
ndb/include/ndbapi/NdbRecAttr.hpp:
made an operator<< friend to NdbRecAttr
ndb/src/kernel/blocks/backup/restore/Restore.cpp:
Rewritten restore to remove NdbSchema
ndb/src/kernel/blocks/backup/restore/Restore.hpp:
Rewritten restore to remove NdbSchema
ndb/src/kernel/blocks/backup/restore/main.cpp:
Rewritten restore to remove NdbSchema
ndb/src/ndbapi/Makefile.am:
removed NdbSchema from ndbapi
ndb/src/ndbapi/NdbDictionary.cpp:
added operator << for Column::Type
ndb/src/ndbapi/NdbRecAttr.cpp:
updated operator<< for NdbRecAttr
ndb/src/ndbapi/Ndberr.cpp:
removed NdbSchema from ndbapi
ndb/test/src/Makefile.am:
moved NdbSchema to test
ndb/test/src/NDBT_ResultRow.cpp:
use common print method for NDBT_ResultRow
ndb/test/src/NdbBackup.cpp:
fixed bug in testBackup
ndb/test/src/NdbSchemaCon.cpp:
moved NdbError NdbSchema
ndb/test/src/NdbSchemaOp.cpp:
updated include file list
Diffstat (limited to 'ndb/test/src')
-rw-r--r-- | ndb/test/src/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/test/src/NDBT_ResultRow.cpp | 74 | ||||
-rw-r--r-- | ndb/test/src/NdbBackup.cpp | 12 | ||||
-rw-r--r-- | ndb/test/src/NdbSchemaCon.cpp | 169 | ||||
-rw-r--r-- | ndb/test/src/NdbSchemaOp.cpp | 220 |
5 files changed, 401 insertions, 77 deletions
diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index d062eeae76c..a513086dc33 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -8,7 +8,8 @@ libNDBT_a_SOURCES = \ HugoOperations.cpp HugoTransactions.cpp \ HugoAsynchTransactions.cpp UtilTransactions.cpp \ NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ - NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp + NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \ + NdbSchemaCon.cpp NdbSchemaOp.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/common/mgmcommon -I$(top_srcdir)/ndb/include/mgmcommon -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index 350a9719c2c..2539d6be0cc 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -118,78 +118,8 @@ BaseString NDBT_ResultRow::c_str() { NdbOut & operator << (NdbOut& ndbout, const NDBT_ResultRow & res) { - for(int i = 0; i<res.cols; i++){ - if(res.data[i]->isNULL()) - ndbout << "NULL"; - else{ - const int size = res.data[i]->attrSize(); - const int aSize = res.data[i]->arraySize(); - switch(convertColumnTypeToAttrType(res.data[i]->getType())){ - case UnSigned: - switch(size){ - case 8: - ndbout << res.data[i]->u_64_value(); - break; - case 4: - ndbout << res.data[i]->u_32_value(); - break; - case 2: - ndbout << res.data[i]->u_short_value(); - break; - case 1: - ndbout << (unsigned) res.data[i]->u_char_value(); - break; - default: - ndbout << "Unknown size"; - } - break; - - case Signed: - switch(size){ - case 8: - ndbout << res.data[i]->int64_value(); - break; - case 4: - ndbout << res.data[i]->int32_value(); - break; - case 2: - ndbout << res.data[i]->short_value(); - break; - case 1: - ndbout << (int) res.data[i]->char_value(); - break; - default: - ndbout << "Unknown size"; - } - break; - - case String: - { - char * buf = new char[aSize+1]; - memcpy(buf, res.data[i]->aRef(), aSize); - buf[aSize] = 0; - ndbout << buf; - delete [] buf; - // Null terminate string - //res.data[i][res.sizes[i]] = 0; - //ndbout << res.data[i]; - } - break; - - case Float: - ndbout_c("%f", res.data[i]->float_value()); - break; - - default: - ndbout << "Unknown(" << - convertColumnTypeToAttrType(res.data[i]->getType()) << ")"; - break; - } - } - if (i < res.cols-1) - ndbout << res.ad; - } - + for(int i = 0; i<res.cols; i++) + ndbout << res.data[i]; return ndbout; } diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 13dc67748a5..169034e0c07 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -90,8 +90,9 @@ NdbBackup::getFileSystemPathForNode(int _node_id){ ndbout << "Invalid configuration fetched, DB missing" << endl; return NULL; } - unsigned int type; - if(!iter.get(CFG_TYPE_OF_SECTION, &type) || type != NODE_TYPE_DB){ + unsigned int type = 123456; + if(iter.get(CFG_TYPE_OF_SECTION, &type) || type != NODE_TYPE_DB){ + ndbout <<"type = " << type << endl; ndbout <<"Invalid configuration fetched, I'm wrong type of node" << endl; return NULL; } @@ -114,10 +115,13 @@ NdbBackup::execRestore(bool _restore_data, const int buf_len = 1000; char buf[buf_len]; + ndbout << "getFileSystemPathForNode "<< _node_id <<endl; + const char* path = getFileSystemPathForNode(_node_id); if (path == NULL) return -1; + ndbout << "getHostName "<< _node_id <<endl; const char *host; if (!getHostName(_node_id, &host)){ return -1; @@ -138,7 +142,7 @@ NdbBackup::execRestore(bool _restore_data, ndbout << "res: " << res << endl; #if 0 - snprintf(buf, 255, "restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d", + snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d", ownNodeId, addr, _node_id, @@ -150,7 +154,7 @@ NdbBackup::execRestore(bool _restore_data, #endif - snprintf(buf, 255, "restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .", + snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .", ownNodeId, addr, _node_id, diff --git a/ndb/test/src/NdbSchemaCon.cpp b/ndb/test/src/NdbSchemaCon.cpp new file mode 100644 index 00000000000..0de49ff983f --- /dev/null +++ b/ndb/test/src/NdbSchemaCon.cpp @@ -0,0 +1,169 @@ +/* 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 */ + + + +/********************************************************************* +Name: NdbSchemaCon.cpp +Include: +Link: +Author: UABMNST Mona Natterkvist UAB/B/SD + EMIKRON Mikael Ronstrom +Date: 020826 +Version: 3.0 +Description: Old Interface between application and NDB +Documentation: +Adjust: 980126 UABMNST First version. + 020826 EMIKRON New version adapted to new DICT version + 040524 Magnus Svensson - Adapted to not be included in public NdbApi + unless the user wants to use it. + + NOTE: This file is only used as a compatibility layer for old test programs, + New programs should use NdbDictionary.hpp +*********************************************************************/ + +#include <ndb_global.h> +#include <NdbApi.hpp> +#include <NdbSchemaCon.hpp> +#include <NdbSchemaOp.hpp> + + +/********************************************************************* +NdbSchemaCon(Ndb* aNdb); + +Parameters: aNdb: Pointers to the Ndb object +Remark: Creates a schemacon object. +************************************************************************************************/ +NdbSchemaCon::NdbSchemaCon( Ndb* aNdb ) : + theNdb(aNdb), + theFirstSchemaOpInList(NULL), + theMagicNumber(0x75318642) +{ + theError.code = 0; +}//NdbSchemaCon::NdbSchemaCon() + +/********************************************************************* +~NdbSchemaCon(); + +Remark: Deletes the connection object. +************************************************************************************************/ +NdbSchemaCon::~NdbSchemaCon() +{ +}//NdbSchemaCon::~NdbSchemaCon() + +/********************************************************************* +NdbSchemaOp* getNdbSchemaOp(); + +Return Value Return a pointer to a NdbSchemaOp object if getNdbSchemaOp was sussesful. + Return NULL: In all other case. +Parameters: tableId : Id of the database table beeing deleted. +************************************************************************************************/ +NdbSchemaOp* +NdbSchemaCon::getNdbSchemaOp() +{ + NdbSchemaOp* tSchemaOp; + if (theFirstSchemaOpInList != NULL) { + theError.code = 4401; // Only support one add table per transaction + return NULL; + }//if + tSchemaOp = new NdbSchemaOp(theNdb); + if ( tSchemaOp == NULL ) { + theError.code = 4000; // Could not allocate schema operation + return NULL; + }//if + theFirstSchemaOpInList = tSchemaOp; + int retValue = tSchemaOp->init(this); + if (retValue == -1) { + release(); + theError.code = 4000; // Could not allocate buffer in schema operation + return NULL; + }//if + return tSchemaOp; +}//NdbSchemaCon::getNdbSchemaOp() + +/********************************************************************* +int execute(); + +Return Value: Return 0 : execute was successful. + Return -1: In all other case. +Parameters : aTypeOfExec: Type of execute. +Remark: Initialise connection object for new transaction. +************************************************************************************************/ +int +NdbSchemaCon::execute() +{ + if(theError.code != 0) { + return -1; + }//if + + NdbSchemaOp* tSchemaOp; + + tSchemaOp = theFirstSchemaOpInList; + if (tSchemaOp == NULL) { + theError.code = 4402; + return -1; + }//if + + if ((tSchemaOp->sendRec() == -1) || (theError.code != 0)) { + // Error Code already set in other place + return -1; + }//if + + return 0; +}//NdbSchemaCon::execute() + +/********************************************************************* +void release(); + +Remark: Release all schemaop. +************************************************************************************************/ +void +NdbSchemaCon::release() +{ + NdbSchemaOp* tSchemaOp; + tSchemaOp = theFirstSchemaOpInList; + if (tSchemaOp != NULL) { + tSchemaOp->release(); + delete tSchemaOp; + }//if + theFirstSchemaOpInList = NULL; + return; +}//NdbSchemaCon::release() + +#include <NdbError.hpp> + +static void +update(const NdbError & _err){ + NdbError & error = (NdbError &) _err; + ndberror_struct ndberror = (ndberror_struct)error; + ndberror_update(&ndberror); + error = NdbError(ndberror); +} + +const +NdbError & +NdbSchemaCon::getNdbError() const { + update(theError); + return theError; +} + + + + + + + + diff --git a/ndb/test/src/NdbSchemaOp.cpp b/ndb/test/src/NdbSchemaOp.cpp new file mode 100644 index 00000000000..a296094ea9d --- /dev/null +++ b/ndb/test/src/NdbSchemaOp.cpp @@ -0,0 +1,220 @@ +/* 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 */ + + +/***************************************************************************** +Name: NdbSchemaOp.cpp +Include: +Link: +Author: UABMNST Mona Natterkvist UAB/B/SD + EMIKRON Mikael Ronstrom +Date: 040524 +Version: 3.0 +Description: Interface between application and NDB +Documentation: Handles createTable and createAttribute calls + +Adjust: 980125 UABMNST First version. + 020826 EMIKRON New version for new DICT + 040524 Magnus Svensson - Adapted to not be included in public NdbApi + unless the user wants to use it. + + NOTE: This file is only used as a compatibility layer for old test programs, + New programs should use NdbDictionary.hpp +*****************************************************************************/ + +#include <ndb_global.h> +#include <NdbApi.hpp> +#include <NdbSchemaOp.hpp> +#include <NdbSchemaCon.hpp> + + +/***************************************************************************** +NdbSchemaOp(Ndb* aNdb, Table* aTable); + +Return Value: None +Parameters: aNdb: Pointers to the Ndb object. + aTable: Pointers to the Table object +Remark: Creat an object of NdbSchemaOp. +*****************************************************************************/ +NdbSchemaOp::NdbSchemaOp(Ndb* aNdb) : + theNdb(aNdb), + theSchemaCon(NULL), + m_currentTable(NULL) +{ +}//NdbSchemaOp::NdbSchemaOp() + +/***************************************************************************** +~NdbSchemaOp(); + +Remark: Delete tables for connection pointers (id). +*****************************************************************************/ +NdbSchemaOp::~NdbSchemaOp( ) +{ +}//~NdbSchemaOp::NdbSchemaOp() + +/***************************************************************************** +int createTable( const char* tableName ) +*****************************************************************************/ +int +NdbSchemaOp::createTable(const char* aTableName, + Uint32 aTableSize, + KeyType aTupleKey, + int aNrOfPages, + FragmentType aFragmentType, + int aKValue, + int aMinLoadFactor, + int aMaxLoadFactor, + int aMemoryType, + bool aStoredTable) +{ + if(m_currentTable != 0){ + return -1; + } + + m_currentTable = new NdbDictionary::Table(aTableName); + m_currentTable->setKValue(aKValue); + m_currentTable->setMinLoadFactor(aMinLoadFactor); + m_currentTable->setMaxLoadFactor(aMaxLoadFactor); + m_currentTable->setLogging(aStoredTable); + m_currentTable->setFragmentType(NdbDictionary::Object::FragAllMedium); + return 0; +}//NdbSchemaOp::createTable() + +/****************************************************************************** +int createAttribute( const char* anAttrName, + KeyType aTupleyKey, + int anAttrSize, + int anArraySize, + AttrType anAttrType, + SafeType aSafeType, + StorageMode aStorageMode, + int aNullAttr, + int aStorageAttr ); + +******************************************************************************/ +int +NdbSchemaOp::createAttribute( const char* anAttrName, + KeyType aTupleKey, + int anAttrSize, + int anArraySize, + AttrType anAttrType, + StorageMode aStorageMode, + bool nullable, + StorageAttributeType aStorageAttr, + int aDistributionKeyFlag, + int aDistributionGroupFlag, + int aDistributionGroupNoOfBits, + bool aAutoIncrement, + const char* aDefaultValue) +{ + if (m_currentTable == 0){ + return -1; + }//if + + NdbDictionary::Column col(anAttrName); + switch(anAttrType){ + case Signed: + if(anAttrSize == 64) + col.setType(NdbDictionary::Column::Bigint); + else + col.setType(NdbDictionary::Column::Int); + break; + case UnSigned: + if(anAttrSize == 64) + col.setType(NdbDictionary::Column::Bigunsigned); + else + col.setType(NdbDictionary::Column::Unsigned); + break; + case Float: + if(anAttrSize == 64) + col.setType(NdbDictionary::Column::Double); + else + col.setType(NdbDictionary::Column::Float); + break; + case String: + col.setType(NdbDictionary::Column::Char); + break; + case NoAttrTypeDef: + abort(); + } + col.setLength(anArraySize); + col.setNullable(nullable); + if(aTupleKey != NoKey) + col.setPrimaryKey(true); + else + col.setPrimaryKey(false); + + col.setDistributionKey(aDistributionKeyFlag); + col.setDistributionGroup(aDistributionGroupFlag,aDistributionGroupNoOfBits); + col.setAutoIncrement(aAutoIncrement); + col.setDefaultValue(aDefaultValue != 0 ? aDefaultValue : ""); + + m_currentTable->addColumn(col); + return 0; +} + +/****************************************************************************** +void release(); + +Remark: Release all objects connected to the schemaop object. +******************************************************************************/ +void +NdbSchemaOp::release(){ +}//NdbSchemaOp::release() + +/****************************************************************************** +int sendRec() + +Return Value: Return 0 : send was succesful. + Return -1: In all other case. +Parameters: +Remark: Send and receive signals for schema transaction based on state +******************************************************************************/ +int +NdbSchemaOp::sendRec(){ + int retVal = 0; + if(m_currentTable == 0){ + retVal = -1; + } else { + retVal = theNdb->getDictionary()->createTable(* m_currentTable); + delete m_currentTable; + theSchemaCon->theError.code = theNdb->getDictionary()->getNdbError().code; + } + + return retVal; +}//NdbSchemaOp::sendRec() + +/****************************************************************************** +int init(); + +Return Value: Return 0 : init was successful. + Return -1: In all other case. +Remark: Initiates SchemaOp record after allocation. +******************************************************************************/ +int +NdbSchemaOp::init(NdbSchemaCon* aSchemaCon) +{ + theSchemaCon = aSchemaCon; + return 0; +}//NdbSchemaOp::init() + + +const NdbError & +NdbSchemaOp::getNdbError() const +{ + return theSchemaCon->getNdbError(); +} + |