#At http://bazaar.launchpad.net/~mordred/mysql-server/mysql-5.1-telco-6.2
2630 Monty Taylor 2008-06-18
Removed swig dir... adding it was premature.
removed:
storage/ndb/swig/
storage/ndb/swig/Makefile.am
storage/ndb/swig/globals.i
storage/ndb/swig/mgmapi/
storage/ndb/swig/mgmapi/ClusterState.i
storage/ndb/swig/mgmapi/NdbLogEvent.i
storage/ndb/swig/mgmapi/NdbLogEventManager.i
storage/ndb/swig/mgmapi/NdbMgm.i
storage/ndb/swig/mgmapi/NdbMgmFactory.i
storage/ndb/swig/mgmapi/NdbMgmReply.i
storage/ndb/swig/mgmapi/NodeState.i
storage/ndb/swig/mgmapi/events.i
storage/ndb/swig/mgmapi/listeners.i
storage/ndb/swig/mgmapi/mgmglobals.i
storage/ndb/swig/ndbapi/
storage/ndb/swig/ndbapi/Ndb.i
storage/ndb/swig/ndbapi/NdbBlob.i
storage/ndb/swig/ndbapi/NdbClusterConnection.i
storage/ndb/swig/ndbapi/NdbDictionary.i
storage/ndb/swig/ndbapi/NdbError.i
storage/ndb/swig/ndbapi/NdbEventOperation.i
storage/ndb/swig/ndbapi/NdbFactory.i
storage/ndb/swig/ndbapi/NdbIndexOperation.i
storage/ndb/swig/ndbapi/NdbIndexScanOperation.i
storage/ndb/swig/ndbapi/NdbOperation.i
storage/ndb/swig/ndbapi/NdbRecAttr.i
storage/ndb/swig/ndbapi/NdbScanFilter.i
storage/ndb/swig/ndbapi/NdbScanOperation.i
storage/ndb/swig/ndbapi/NdbTransaction.i
storage/ndb/swig/ndbapi/ndbglobals.i
=== removed directory 'storage/ndb/swig'
=== removed file 'storage/ndb/swig/Makefile.am'
--- a/storage/ndb/swig/Makefile.am 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
-# Copyright (C) 2004-2006 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; 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 $(top_srcdir)/storage/ndb/config/common.mk.am
-
-nobase_swiginclude_HEADERS = \
-mgmapi/mgmglobals.i \
-mgmapi/ClusterState.i \
-mgmapi/events.i \
-mgmapi/listeners.i \
-mgmapi/NdbLogEvent.i \
-mgmapi/NdbLogEventManager.i \
-mgmapi/NdbMgmFactory.i \
-mgmapi/NdbMgm.i \
-mgmapi/NdbMgmReply.i \
-mgmapi/NodeState.i \
-ndbapi/NdbError.i \
-ndbapi/ndbglobals.i \
-ndbapi/NdbIndexScanOperation.i \
-ndbapi/NdbOperation.i \
-ndbapi/NdbScanFilter.i \
-ndbapi/NdbScanOperation.i \
-ndbapi/NdbBlob.i \
-ndbapi/NdbClusterConnection.i \
-ndbapi/NdbDictionary.i \
-ndbapi/NdbEventOperation.i \
-ndbapi/NdbFactory.i \
-ndbapi/Ndb.i \
-ndbapi/NdbIndexOperation.i \
-ndbapi/NdbRecAttr.i \
-ndbapi/NdbTransaction.i \
-globals.i
-
-dist-hook:
- -rm -rf `find $(distdir) -type d -name SCCS`
-
-windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
=== removed file 'storage/ndb/swig/globals.i'
--- a/storage/ndb/swig/globals.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/globals.i 1970-01-01 00:00:00 +0000
@@ -1,75 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if !defined(SWIGLUA)
-%include "typemaps.i"
-#endif
-
-%include "exception.i"
-
- //%include "cstring.i"
-
-%include "ndberror.h"
-%include "ndb_constants.h"
-%include "ndb_init.h"
-
- // Suppress SWIG warning
-#pragma SWIG nowarn=SWIGWARN_PARSE_NESTED_CLASS
-
-%define %ndbexception(EXCEPTION)
-#if defined(SWIGJAVA)
-%javaexception(EXCEPTION)
-#else
-%exception
-#endif
-%enddef
-
-%define %ndbnoexception
-#if defined(SWIGJAVA)
-%nojavaexception;
-#else
-%noexception; // clear exception handler
-#endif
-%enddef
-
-%{
- enum NdbException {
- BaseRuntimeError,
- NdbApiException,
- BlobUndefinedException,
- NdbApiPermanentException,
- NdbApiRuntimeException,
- NdbApiTemporaryException,
- NdbApiTimeStampOutOfBoundsException,
- NdbApiUserErrorPermanentException,
- NdbClusterConnectionPermanentException,
- NdbClusterConnectionTemporaryException,
- NoSuchColumnException,
- NoSuchIndexException,
- NoSuchTableException,
- NdbMgmException,
- InvalidSchemaObjectVersionException,
- };
- %}
-
-typedef unsigned long long Uint64;
-typedef unsigned int Uint32;
-typedef signed long long Int64;
-typedef signed int Int32;
=== removed directory 'storage/ndb/swig/mgmapi'
=== removed file 'storage/ndb/swig/mgmapi/ClusterState.i'
--- a/storage/ndb/swig/mgmapi/ClusterState.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/ClusterState.i 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-/**
- * State of all nodes in the cluster; returned from
- * ndb_mgm_get_status()
- */
-
-%rename ndb_mgm_cluster_state ClusterState;
-
-struct ndb_mgm_cluster_state {
-private:
- ndb_mgm_cluster_state();
- ~ndb_mgm_cluster_state();
- /** Number of entries in the node_states array */
- int no_of_nodes;
- /** An array with node_states*/
- %immutable;
- struct ndb_mgm_node_state node_states[];
- %mutable;
-};
-
-
-%extend ndb_mgm_cluster_state {
-
-public:
- int getNoOfNodes() {
- return self->no_of_nodes;
- }
-
- ndb_mgm_node_state * getNodeState(int nodeId) {
- if (nodeId < self->no_of_nodes) {
- return &(self->node_states[nodeId]);
- }
- return NULL;
- }
-};
-
=== removed file 'storage/ndb/swig/mgmapi/NdbLogEvent.i'
--- a/storage/ndb/swig/mgmapi/NdbLogEvent.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/NdbLogEvent.i 1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/** Log event specific data for for corresponding NDB_LE_ log event */
-
-/**
- * The NdbLogevent
- */
-%rename ndb_logevent NdbLogEvent;
-
-class ndb_logevent {
-
- /** NdbLogEventHandle (to be used for comparing only)
- * set in ndb_logevent_get_next()
- */
- void *handle;
-
- /** Which event */
- enum Ndb_logevent_type type;
-
- /** Time when log event was registred at the management server */
- unsigned time;
-
- /** Category of log event */
- enum ndb_mgm_event_category category;
-
- /** Severity of log event */
- enum ndb_mgm_event_severity severity;
-
- /** Level (0-15) of log event */
- unsigned level;
-
- /** Node ID of the node that reported the log event */
- unsigned source_nodeid;
-
-};
-
-%extend ndb_logevent {
-
-public:
-
- Ndb_logevent_type getEventType() {
- return $self->type;
- }
-
- ndb_mgm_event_category getEventCategory() {
- return $self->category;
- }
-
- ndb_mgm_event_severity getEventSeverity() {
- return $self->severity;
- }
-
- Uint32 getSourceNodeId() {
- return $self->source_nodeid;
- }
-
- Uint32 getEventTime() {
- return $self->time;
- }
-
- Uint32 getEventLevel() {
- return $self->level;
- }
-
-};
-
-
-
=== removed file 'storage/ndb/swig/mgmapi/NdbLogEventManager.i'
--- a/storage/ndb/swig/mgmapi/NdbLogEventManager.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/NdbLogEventManager.i 1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%{
-#include "NdbEventListener.hpp"
- %}
-
-
-%feature("director") NdbLogEventTypeListener;
-%feature("director") NdbLogEventCategoryListener;
-
-class NdbLogEventListener {
-public:
- virtual ~NdbLogEventListener();
-// virtual void le_handleEvent(const ndb_logevent & theEvent);
-};
-class NdbLogEventCategoryListener {
-public:
- virtual ~NdbLogEventCategoryListener();
-// virtual void le_handleEvent(const ndb_logevent & theEvent);
- virtual ndb_mgm_event_category getEventCategory();
-};
-class NdbLogEventTypeListener {
-public:
- virtual ~NdbLogEventTypeListener();
-// virtual void le_handleEvent(const ndb_logevent & theEvent);
- virtual Ndb_logevent_type getEventType();
-};
-
-%typemap(newfree) (BaseEventWrapper *) "free($1);";
-%newobject NdbLogEventManager::getLogEvent;
-
-class NdbLogEventManager {
- NdbLogEventManager();
- ndb_logevent_handle * handle;
- NdbLogEventManager(ndb_logevent_handle * theHandle);
-public:
- // Returns -1 on error, 0 otherwise
- ~NdbLogEventManager();
- bool unregisterListener(NdbLogEventTypeListener * listener);
- bool unregisterListener(NdbLogEventCategoryListener * listener);
-
- %ndbexception("NdbMgmException") {
- $action
- if (result < 0) {
- NDB_exception(NdbMgmException,"Must deregister handler before adding a new one");
- }
- }
- int registerListener(NdbLogEventTypeListener * listener);
- int registerListener(NdbLogEventCategoryListener * listener);
-
-
- %ndbexception("NdbMgmException") {
- $action
- if (result->ret < 0) {
- NDB_exception(NdbMgmException,arg1->getMgmError());
- }
- }
- BaseEventWrapper * getLogEvent(unsigned timeout_in_milliseconds);
-
- %ndbexception("NdbMgmException") {
- $action
- if (result < 0) {
- NDB_exception(NdbMgmException,arg1->getMgmError());
- }
- }
- int pollEvents(unsigned timeout_in_milliseconds);
- %ndbnoexception;
-};
-
-
=== removed file 'storage/ndb/swig/mgmapi/NdbMgm.i'
--- a/storage/ndb/swig/mgmapi/NdbMgm.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/NdbMgm.i 1970-01-01 00:00:00 +0000
@@ -1,848 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%{
-
- struct BackupWrapper {
- unsigned int backupId;
- ndb_mgm_reply* theReply;
- };
-
- %}
-
-
-/**
- * The NdbMgmHandle.
- */
-%rename ndb_mgm_handle NdbMgm;
-%typemap(freearg) (ndb_mgm_reply *) "free($1);";
-
-/*We don't really need this - we're going to free in the typemap
- %typemap(newfree) (BackupWrapper *) "free($1->theReply); free($1);";
- %newobject NdbMgm::startBackup;
-*/
-
-struct ndb_mgm_handle {
-private:
-
- ndb_mgm_handle();
- ~ndb_mgm_handle();
-
-};
-
-typedef ndb_mgm_handle * NdbMgmHandle;
-
-
-
-%extend ndb_mgm_handle {
-
-public:
- /**
- * Destroy a management server handle.
- *
- * @param handle Management handle
- */
- ~ndb_mgm_handle() {
- ndb_mgm_destroy_handle(&$self);
- }
-
-
- /***************************************************************************/
- /**
- * @name Functions: Error Handling
- * @{
- */
-
- /**
- * Get the most recent error
- *
- * @return Latest error code
- */
-
- int getNdbMgmErrorCode() {
- return ndb_mgm_get_latest_error($self);
- }
-
- int getLatestErrorCode() {
- return ndb_mgm_get_latest_error($self);
- }
-
- /**
- * Get the most recent general error message
- *
- * @return Latest error message
- */
- const char * getNdbMgmErrorMsg() {
- return ndb_mgm_get_latest_error_msg($self);
- }
-
- const char * getLatestErrorMsg()
- {
- return ndb_mgm_get_latest_error_msg($self);
- }
-
-
- /**
- * Get the most recent error description
- *
- * The error description gives some additional information regarding
- * the error message.
- *
- * @return Latest error description
- */
- const char * getLatestErrorDesc()
- {
- return ndb_mgm_get_latest_error_desc($self);
- }
-
- /**
- * Set error stream
- *
- void setErrorStream(FILE * errStream)
- {
- ndb_mgm_set_error_stream($self, errStream);
- } */
-
-
- /**
- * Set a name of the handle. Name is reported in cluster log.
- *
- * @param name Name
- */
- void setName(const char *name) {
- ndb_mgm_set_name($self, name);
- }
-
- %ndbexception("NdbMgmException") {
- $action
- if (result == -1) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
- /** @} *********************************************************************/
- /**
- * @name Functions: Connect/Disconnect Management Server
- * @{
- */
-
- /**
- * Sets the connectstring for a management server
- *
- * @param handle Management handle
- * @param connect_string Connect string to the management server,
- *
- * @return -1 on error.
- *
- * @code
- * <connectstring> := [<nodeid-specification>,]<host-specification>[,<host-specification>]
- * <nodeid-specification> := nodeid=<id>
- * <host-specification> := <host>[:<port>]
- * <id> is an integer greater than 0 identifying a node in config.ini
- * <port> is an integer referring to a regular unix port
- * <host> is a string containing a valid network host address
- * @endcode
- */
- int setConnectstring(const char *connect_string) {
- return ndb_mgm_set_connectstring($self,connect_string);
- }
-
- /**
- * Returns the number of management servers in the connect string
- * (as set by ndb_mgm_set_connectstring()). This can be used
- * to help work out how long the maximum amount of time that
- * ndb_mgm_connect can take.
- *
- * @param handle Management handle
- *
- * @return < 0 on error
- */
-
- /**
- * Set local bindaddress
- * @param arg - Srting of form "host[:port]"
- * @note must be called before connect
- * @note Error on binding local address will not be reported until connect
- * @return 0 on success
- */
- int setBindaddress(const char * arg) {
- return ndb_mgm_set_bindaddress($self, arg);
- }
-
- /**
- * Gets the connectstring used for a connection
- *
- * @note This function returns the default connectstring if no call to
- * ndb_mgm_set_connectstring() has been performed. Also, the
- * returned connectstring may be formatted differently.
- *
- * @param handle Management handle
- * @param buf Buffer to hold result
- * @param buf_sz Size of buffer.
- *
- * @return connectstring (same as <var>buf</var>)
- */
-// TODO: Do something sensible with this
-// const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
-
- /**
- *
- * @param handle NdbMgmHandle
- * @param seconds number of seconds
- * @return non-zero on success
- */
- int setConnectTimeout(Uint32 seconds) {
- return ndb_mgm_set_connect_timeout($self, seconds);
- }
-
- /**
- * Connects to a management server. Connectstring is set by
- * ndb_mgm_set_connectstring().
- *
- * The timeout value is for connect to each management server.
- * Use ndb_mgm_number_of_mgmd_in_connect_string to work out
- * the approximate maximum amount of time that could be spent in this
- * function.
- *
- * @param handle Management handle.
- * @param no_retries Number of retries to connect
- * (0 means connect once).
- * @param retry_delay_in_seconds
- * How long to wait until retry is performed.
- * @param verbose Make printout regarding connect retries.
- *
- * @return -1 on error.
- */
- int connect( const char * connectString,int no_retries, int retry_delay_in_seconds, bool verbose) {
- if (ndb_mgm_set_connectstring($self,connectString)==-1)
- return -1;
- return ndb_mgm_connect($self, no_retries, retry_delay_in_seconds, verbose);
- }
- int connect( int no_retries, int retry_delay_in_seconds, bool verbose) {
- return ndb_mgm_connect($self, no_retries, retry_delay_in_seconds, verbose);
- }
-
-
- /**
- * Disconnects from a management server
- *
- * @param handle Management handle.
- * @return -1 on error.
- */
- int disconnect() {
- return ndb_mgm_disconnect($self);
- }
-
- /**
- * Gets connection node ID
- *
- * @param handle Management handle
- *
- * @return Node ID; 0 indicates that no node ID has been
- * specified
- */
- int getConfigurationNodeid() {
- return ndb_mgm_get_configuration_nodeid($self);
- }
-
- /**
- * Gets connection port
- *
- * @param handle Management handle
- *
- * @return port
- */
- int getConnectedPort() {
- return ndb_mgm_get_connected_port($self);
- }
-
-
- %ndbnoexception;
- /**
- * Return true if connected.
- *
- * @param handle Management handle
- * @return 0 if not connected, non-zero if connected.
- */
- bool isConnected() {
- return ( ndb_mgm_is_connected($self) == 0 ) ? false : true ;
- }
-
- %ndbexception("NdbMgmException") {
- $action
- if (result == NULL) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- /**
- * Gets connection host
- *
- * @param handle Management handle
- *
- * @return hostname
- */
- const char * getConnectedHost() {
- return ndb_mgm_get_connected_host($self);
- }
-
-
-
- /** @} *********************************************************************/
- /**
- * @name Functions: Backup
- * @{
- */
-
- /**
- * Start backup
- *
- * @param wait_completed 0: Don't wait for confirmation<br>
- * 1: Wait for backup to be started<br>
- * 2: Wait for backup to be completed
- * @param backup_id Backup ID is returned from function.
- * @return Reply message. NULL on error.
- * @note backup_id will not be returned if
- * wait_completed == 0
- */
-
- %ndbexception("NdbMgmException") {
- $action
- if (result->theReply == NULL) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- BackupWrapper * startBackup(BackupStartOption wait_completed) {
-
- ndb_mgm_reply * reply = (ndb_mgm_reply *)malloc(sizeof(ndb_mgm_reply));
- unsigned int backup_id=0;
- if (reply == NULL) {
- return NULL;
- }
- int ret = ndb_mgm_start_backup($self, (int)wait_completed,
- &backup_id, reply);
- if (ret == -1) {
- free(reply);
- return NULL;
- }
- BackupWrapper * reply_wrapper = (BackupWrapper *)malloc(sizeof(BackupWrapper));
- if (reply_wrapper == NULL) {
- free(reply);
- return NULL;
- }
- reply_wrapper->theReply=reply;
- reply_wrapper->backupId=backup_id;
- return reply_wrapper;
- }
-
- /**
- * Abort backup
- *
- * @param backup_id Backup ID.
- * @return Reply message. NULL on error.
- */
- %ndbexception("NdbMgmException") {
- $action
- if (result == NULL) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- %newobject abortBackup;
- ndb_mgm_reply* abortBackup(unsigned int backup_id) {
- ndb_mgm_reply * reply = (ndb_mgm_reply *)malloc(sizeof(ndb_mgm_reply));
- if (reply == NULL) {
- return NULL;
- }
- int ret = ndb_mgm_abort_backup($self, backup_id, reply);
- if (ret == -1) {
- free(reply);
- return NULL;
- }
- return reply;
- }
-
- /** @} *********************************************************************/
- /**
- * @name Functions: Cluster status
- * @{
- */
-
- /**
- * Gets status of the nodes in an NDB Cluster
- *
- * @note The caller must free the pointer returned by this function.
- *
- *
- * @return Cluster state (or <var>NULL</var> on error).
- */
- %newobject getStatus;
- ndb_mgm_cluster_state * getStatus() {
- return ndb_mgm_get_status($self);
- }
-
-
- %ndbexception("NdbMgmException") {
- $action
- if (result != NULL && result->return_code < 0) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- NDB_exception(NdbMgmException,result->message);
- } else if (result == NULL) {
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- /** @} *********************************************************************/
- /**
- * @name Functions: Single User Mode
- * @{
- */
-
- /**
- * Enter Single user mode
- *
- * @param handle NDB management handle.
- * @param nodeId Node ID of the single user node
- * @param reply Reply message.
- * @return -1 on error.
- */
- %newobject enterSingleUserMode;
- ndb_mgm_reply * enterSingleUserMode(unsigned int nodeId)
- {
- ndb_mgm_reply * reply = (ndb_mgm_reply *)malloc(sizeof(ndb_mgm_reply));
- if (reply == NULL) {
- return NULL;
- }
- memset(reply,0,sizeof(ndb_mgm_reply));
- int ret = ndb_mgm_enter_single_user($self, nodeId, reply);
-
- if (ret == -1) {
- free(reply);
- return NULL;
- }
- return reply;
- }
-
- /**
- * Exit Single user mode
- *
- * @param handle NDB management handle.
- * @param reply Reply message.
- *
- * @return -1 on error.
- */
- %newobject exitSingleUserMode;
- ndb_mgm_reply * exitSingleUserMode()
- {
- ndb_mgm_reply * reply = (ndb_mgm_reply *)malloc(sizeof(ndb_mgm_reply));
- if (reply == NULL) {
- return NULL;
- }
- memset(reply,0,sizeof(ndb_mgm_reply));
- int ret = ndb_mgm_exit_single_user($self,reply);
- if (ret == -1) {
- free(reply);
- return NULL;
- }
- return reply;
- }
-
-
- %ndbexception("NdbMgmException") {
- $action
- if (result == -1) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- /** @} *********************************************************************/
- /**
- * @name Functions: Start/stop nodes
- * @{
- */
-
- /**
- * Stops database nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to be stopped<br>
- * 0: All database nodes in cluster<br>
- * n: Stop the <var>n</var> node(s) specified in the
- * array node_list
- * @param node_list List of node IDs for database nodes to be stopped
- *
- * @return Number of nodes stopped (-1 on error)
- *
- * @note This function is equivalent
- * to calling ndb_mgm_stop2(handle, no_of_nodes, node_list, 0)
- */
- %apply int *INOUT { int *node_list };
- int stop(int no_of_nodes, const int * node_list) {
- return ndb_mgm_stop($self,no_of_nodes,node_list);
- }
-
- /**
- * Stops database nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to stop<br>
- * 0: All database nodes in cluster<br>
- * n: Stop the <var>n</var> node(s) specified in
- * the array node_list
- * @param node_list List of node IDs of database nodes to be stopped
- * @param abort Don't perform graceful stop,
- * but rather stop immediately
- *
- * @return Number of nodes stopped (-1 on error).
- */
- int stop(int no_of_nodes, const int * node_list, bool abort) {
- return ndb_mgm_stop2($self,no_of_nodes,node_list,abort);
- }
-
- /**
- * Stops cluster nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to stop<br>
- * -1: All database and management nodes<br>
- * 0: All database nodes in cluster<br>
- * n: Stop the <var>n</var> node(s) specified in
- * the array node_list
- * @param node_list List of node IDs of database nodes to be stopped
- * @param abort Don't perform graceful stop,
- * but rather stop immediately
- * @param disconnect Returns true if you need to disconnect to apply
- * the stop command (e.g. stopping the mgm server
- * that handle is connected to)
- *
- * @return Number of nodes stopped (-1 on error).
- */
- %apply int *OUTPUT { int *disconnect };
-
- int stop(int no_of_nodes, const int * node_list, bool abort, int *disconnect) {
- return ndb_mgm_stop3($self,no_of_nodes,node_list,abort,disconnect);
- }
-
-
- /**
- * Restart database nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to restart<br>
- * 0: All database nodes in cluster<br>
- * n: Restart the <var>n</var> node(s) specified in the
- * array node_list
- * @param node_list List of node IDs of database nodes to be restarted
- *
- * @return Number of nodes restarted (-1 on error).
- *
- * @note This function is equivalent to calling
- * ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0);
- */
- int restart(int no_of_nodes, const int * node_list) {
- return ndb_mgm_restart($self,no_of_nodes,node_list);
- }
-
- /**
- * Restart database nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to be restarted:<br>
- * 0: Restart all database nodes in the cluster<br>
- * n: Restart the <var>n</var> node(s) specified in the
- * array node_list
- * @param node_list List of node IDs of database nodes to be restarted
- * @param initial Remove filesystem from restarting node(s)
- * @param nostart Don't actually start node(s) but leave them
- * waiting for start command
- * @param abort Don't perform graceful restart,
- * but rather restart immediately
- *
- * @return Number of nodes stopped (-1 on error).
- */
- int restart(int no_of_nodes,const int * node_list, bool initial,
- bool nostart, bool abort) {
- return ndb_mgm_restart2($self, no_of_nodes, node_list, initial, nostart, abort);
- }
-
- /**
- * Restart nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to be restarted:<br>
- * 0: Restart all database nodes in the cluster<br>
- * n: Restart the <var>n</var> node(s) specified in the
- * array node_list
- * @param node_list List of node IDs of database nodes to be restarted
- * @param initial Remove filesystem from restarting node(s)
- * @param nostart Don't actually start node(s) but leave them
- * waiting for start command
- * @param abort Don't perform graceful restart,
- * but rather restart immediately
- * @param disconnect Returns true if mgmapi client must disconnect from
- * server to apply the requested operation. (e.g.
- * restart the management server)
- *
- *
- * @return Number of nodes stopped (-1 on error).
- */
- int restart(int no_of_nodes, const int * node_list, int initial,
- int nostart, int abort, int *disconnect) {
-
- return ndb_mgm_restart3($self, no_of_nodes, node_list, initial, nostart,
- abort, disconnect);
- }
-
- /**
- * Start database nodes
- *
- * @param handle Management handle.
- * @param no_of_nodes Number of database nodes to be started<br>
- * 0: Start all database nodes in the cluster<br>
- * n: Start the <var>n</var> node(s) specified in
- * the array node_list
- * @param node_list List of node IDs of database nodes to be started
- *
- * @return Number of nodes actually started (-1 on error).
- *
- * @note The nodes to be started must have been started with nostart(-n)
- * argument.
- * This means that the database node binary is started and
- * waiting for a START management command which will
- * actually enable the database node
- */
- int start(int no_of_nodes,
- const int * node_list) {
- return ndb_mgm_start($self, no_of_nodes, node_list);
- }
-
-
- /** @} *********************************************************************/
- /**
- * @name Functions: Controlling Clusterlog output
- * @{
- */
-
- %ndbexception("NdbMgmException") {
- $action
- if (result == -1) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- /**
- * Filter cluster log severities
- *
- * @param handle NDB management handle.
- * @param severity A cluster log severity to filter.
- * @param enable set 1=enable o 0=disable
- * @param reply Reply message.
- *
- * @return -1 on error.
- */
- int setClusterlogSeverityFilter(ndb_mgm_event_severity severity,
- int enable) {
-
- ndb_mgm_reply * reply = NULL;
- int ret = ndb_mgm_set_clusterlog_severity_filter($self, severity, enable, reply);
- if (reply->return_code != 0) {
- ret = -1;
- }
- free(reply);
- return ret;
- }
-
- /**
- * Set log category and levels for the cluster log
- *
- * @param handle NDB management handle.
- * @param nodeId Node ID.
- * @param category Event category.
- * @param level Log level (0-15).
- * @param reply Reply message.
- * @return -1 on error.
- */
- int getClusterlogLoglevel(int nodeId,
- ndb_mgm_event_category category,
- int level, ndb_mgm_reply * reply) {
-
- return ndb_mgm_set_clusterlog_loglevel(self,
- nodeId, category, level,
- reply);
- }
-
- /**
- * Listen to log events. They are read from the return file descriptor
- * and the format is textual, and the same as in the cluster log.
- *
- * @param handle NDB management handle.
- * @param filter pairs of { level, ndb_mgm_event_category } that will be
- * pushed to fd, level=0 ends list.
- *
- * @return fd filedescriptor to read events from
- */
- // TODO: Returns a filedescriptor - um, gonna have to figure that out
- //int ndb_mgm_listen_event(NdbMgmHandle handle, const int filter[])
-
-
- %ndbexception("NdbMgmException") {
- $action
- if (result == NULL) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- /**
- * Get clusterlog severity filter
- *
- * @param handle NDB management handle
- *
- * @param loglevel A vector of seven (NDB_MGM_EVENT_SEVERITY_ALL)
- * elements of struct ndb_mgm_severity,
- * where each element contains
- * 1 if a severity indicator is enabled and 0 if not.
- * A severity level is stored at position
- * ndb_mgm_clusterlog_level;
- * for example the "error" level is stored in position
- * [NDB_MGM_EVENT_SEVERITY_ERROR].
- * The first element [NDB_MGM_EVENT_SEVERITY_ON] in
- * the vector signals whether the cluster log
- * is disabled or enabled.
- * @param severity_size The size of the vector (NDB_MGM_EVENT_SEVERITY_ALL)
- * @return Number of returned severities or -1 on error
- */
- %newobject getClusterLogSeverityFilter;
- ndb_mgm_severity* getClusterLogSeverityFilter() {
- ndb_mgm_severity * theSeverity = NULL;
- int ret = ndb_mgm_get_clusterlog_severity_filter($self,
- theSeverity,
- NDB_MGM_EVENT_SEVERITY_ALL);
- if (ret == -1) {
- theSeverity = NULL;
- }
- return theSeverity;
- }
-
-
-
- /**
- * get log category and levels
- *
- * @param handle NDB management handle.
- * @param loglevel A vector of twelve (MGM_LOGLEVELS) elements
- * of struct ndb_mgm_loglevel,
- * where each element contains
- * loglevel of corresponding category
- * @param loglevel_size The size of the vector (MGM_LOGLEVELS)
- * @return Number of returned loglevels or -1 on error
- */
- ndb_mgm_loglevel * getClusterlogLoglevel() {
- ndb_mgm_loglevel * theLoglevel = NULL;
- int ret = ndb_mgm_get_clusterlog_loglevel($self, theLoglevel, MGM_LOGLEVELS);
- if (ret == -1) {
- theLoglevel = NULL;
- }
- return theLoglevel;
- }
-
- /**
- * Listen to log events.
- *
- * @param handle NDB management handle.
- * @param filter pairs of { level, ndb_mgm_event_category } that will be
- * pushed to fd, level=0 ends list.
- *
- * @return NdbLogEventHandle
- */
- %newobject createNdbLogEventManager;
- NdbLogEventManager * createNdbLogEventManager(const std::vector<NdbFilterItem> filter) {
-
- int theFilter[filter.size()*2+1];
- for(unsigned x=0;x<filter.size();x++) {
- theFilter[x*2]=filter[x].level;
- theFilter[x*2+1]=(int)(filter[x].category);
- }
- theFilter[filter.size()*2]=0;
- return new NdbLogEventManager(ndb_mgm_create_logevent_handle($self,theFilter));
- }
- %apply int *INOUT { int * filter };
- NdbLogEventManager * createNdbLogEventManager(const int * filter) {
-
- return new NdbLogEventManager(ndb_mgm_create_logevent_handle($self,filter));
- }
-
-
- %newobject dumpState;
- %apply int *INOUT { const int * args };
- ndb_mgm_reply * dumpState(int nodeId,
- const int * args,
- int num_args) {
- ndb_mgm_reply * reply = (ndb_mgm_reply *)malloc(sizeof(ndb_mgm_reply));
- if (reply == NULL) {
- return NULL;
- }
- int ret = ndb_mgm_dump_state($self,nodeId,args,num_args,reply);
- if (ret == -1) {
- free(reply);
- return NULL;
- }
- return reply;
-
- }
-
- %ndbexception("NdbMgmException") {
- $action
- if (result < 0) {
- //int errCode = ndb_mgm_get_latest_error(arg1);
- const char * errMsg = ndb_mgm_get_latest_error_msg(arg1);
- NDB_exception(NdbMgmException,errMsg);
- }
- }
-
- int dumpState(int nodeId, int theState) {
- ndb_mgm_reply * reply = (ndb_mgm_reply *)malloc(sizeof(ndb_mgm_reply));
- if (reply == NULL) {
- return -1;
- }
- int theArgs[1];
- theArgs[0]=theState;
- int ret = ndb_mgm_dump_state($self,nodeId,theArgs,1,reply);
- free(reply);
- return ret;
- }
-
- %ndbnoexception;
-};
-
=== removed file 'storage/ndb/swig/mgmapi/NdbMgmFactory.i'
--- a/storage/ndb/swig/mgmapi/NdbMgmFactory.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/NdbMgmFactory.i 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%newobject NdbMgmFactory::createNdbMgm;
-
-%{
-
- class NdbMgmFactory
- {
-
- public:
- static ndb_mgm_handle * createNdbMgm(const char * connectString = 0)
- {
- ndb_mgm_handle * handle = ndb_mgm_create_handle();
- if (handle == NULL) {
- return NULL;
- }
- if (connectString != 0) {
- int ret = ndb_mgm_set_connectstring(handle,connectString);
- if (ret == -1) {
- free(handle);
- return NULL;
- }
- }
- return handle;
- }
- };
-
- %}
-
-
-class NdbMgmFactory
-{
- // We list these here as private so that SWIG doesnt generate them
- NdbMgmFactory();
- ~NdbMgmFactory();
-public:
-
- %ndbexception("NdbMgmException") {
- $action
- if (result==NULL) {
- NDB_exception(NdbMgmException,"Couldn't allocate NdbMgm");
- }
- }
- static ndb_mgm_handle * createNdbMgm(const char * connectString = 0);
-};
-
=== removed file 'storage/ndb/swig/mgmapi/NdbMgmReply.i'
--- a/storage/ndb/swig/mgmapi/NdbMgmReply.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/NdbMgmReply.i 1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * Default reply from the server (reserved for future use)
- */
-%rename ndb_mgm_reply NdbMgmReply;
-
-class ndb_mgm_reply {
-private:
- ndb_mgm_reply();
- ~ndb_mgm_reply();
- /** 0 if successful, otherwise error code. */
- int return_code;
- /** Error or reply message.*/
- char message[256];
-
-};
-
-%extend ndb_mgm_reply {
-
-public:
-
- int getReturnCode() {
- return $self->return_code;
- }
-
- const char * getMessage() {
- return $self->message;
- }
-
-};
=== removed file 'storage/ndb/swig/mgmapi/NodeState.i'
--- a/storage/ndb/swig/mgmapi/NodeState.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/NodeState.i 1970-01-01 00:00:00 +0000
@@ -1,133 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * Status of a node in the cluster.
- *
- * Sub-structure in enum ndb_mgm_cluster_state
- * returned by ndb_mgm_get_status().
- *
- * @note <var>node_status</var>, <var>start_phase</var>,
- * <var>dynamic_id</var>
- * and <var>node_group</var> are relevant only for database nodes,
- * i.e. <var>node_type</var> == @ref NDB_MGM_NODE_TYPE_NDB.
- */
-%rename ndb_mgm_node_state NodeState;
-struct ndb_mgm_node_state {
- /** NDB Cluster node ID*/
-private:
- ndb_mgm_node_state();
- ~ndb_mgm_node_state();
- int node_id;
- /** Type of NDB Cluster node*/
- enum ndb_mgm_node_type node_type;
- /** State of node*/
- enum ndb_mgm_node_status node_status;
- /** Start phase.
- *
- * @note Start phase is only valid if the <var>node_type</var> is
- * NDB_MGM_NODE_TYPE_NDB and the <var>node_status</var> is
- * NDB_MGM_NODE_STATUS_STARTING
- */
- int start_phase;
- /** ID for heartbeats and master take-over (only valid for DB nodes)
- */
- int dynamic_id;
- /** Node group of node (only valid for DB nodes)*/
- int node_group;
- /** Internal version number*/
- int version;
- /** Number of times node has connected or disconnected to the
- * management server
- */
- int connect_count;
- /** IP address of node when it connected to the management server.
- * @note This value will be empty if the management server has restarted
- * since the node last connected.
- */
- %immutable;
- char connect_address[];
- %mutable;
-
-};
-
-%extend ndb_mgm_node_state {
-
-public:
- char * getConnectAddress(void) {
- return $self->connect_address;
- }
-
- int getConnectCount() {
- return $self->connect_count;
- }
-
- int getDynamicID() {
- return $self->dynamic_id;
- }
-
- int getNodeGroup() {
- return $self->node_group;
- }
-
- int getNodeID() {
- return $self->node_id;
- }
-
- ndb_mgm_node_status getNodeStatus() {
- return $self->node_status;
- }
-
- ndb_mgm_node_type getNodeType() {
- return $self->node_type;
- }
-
- int getStartPhase() {
- return $self->start_phase;
- }
-
- int getVersion() {
- return $self->version;
- }
-
- const char * getStartupPhase() {
- const char * startPhaseStr;
-
- switch ($self->start_phase) {
- case 0: startPhaseStr="Startup Phase 0. Clearing the filesystem, --initial was specified as startup option."; break;
- case 1: startPhaseStr="Startup Phase 1. Establishing inter-node connections in cluster."; break;
- case 2: startPhaseStr="Startup Phase 2. The arbitrator node is elected. If this is a system restart, the cluster determines the latest restorable global checkpoint."; break;
- case 3: startPhaseStr="Startup Phase 3. This stage initializes a number of internal cluster variables."; break;
- case 4: startPhaseStr="Startup Phase 4. If initial (re)start: redo log files are created. If system restart: read schemas, LCP, redo logs up to last GCP. Node restart: Find tail of redo log."; break;
- case 5: startPhaseStr="Startup Phase 5. If initial start: creating internal system tables. If node restart or initial restart: include node in transactions, synchronise with node group and master."; break;
- case 6: startPhaseStr="Startup Phase 6. Update Internal variables."; break;
- case 7: startPhaseStr="Startup Phase 7. Update Internal variables."; break;
- case 8: startPhaseStr="Startup Phase 8. If system restart: rebuild all indexes."; break;
- case 9: startPhaseStr="Startup Phase 9. Update Internal variables."; break;
- case 10: startPhaseStr="Startup Phase 10. If node restart or initial node restart: API nodes may connect and send events."; break;
- case 11: startPhaseStr="Startup Phase 11. If node restart or initial node restart: taking responsibility for new transactions. After this pahse, the new node can now act as transaction coordinator."; break;
- default: startPhaseStr="Undefined Startup Phase"; break;
- }
- return startPhaseStr;
- }
-
-
-};
-
=== removed file 'storage/ndb/swig/mgmapi/events.i'
--- a/storage/ndb/swig/mgmapi/events.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/events.i 1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%import "mgmapi/mgmglobals.i"
-%import "mgmapi/NdbLogEvent.i"
-%import "mgmapi/listeners.i"
-
-
-%{
-
-#include <stdio.h>
-#include <vector>
-
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef VERSION
-
-#include "config.h"
-#include "ndb_init.h"
-#include "storage/ndb/mgmapi/mgmapi.h"
-#include "mgmapi_debug.h"
-#include "listeners.hpp"
-#include "events.hpp"
-
-%}
-
-%ignore getEventType;
-%ignore le_handleEvent;
-%include "events.hpp"
=== removed file 'storage/ndb/swig/mgmapi/listeners.i'
--- a/storage/ndb/swig/mgmapi/listeners.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/listeners.i 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%import "mgmapi/mgmglobals.i"
-%import "mgmapi/NdbLogEvent.i"
-%import "mgmapi/events.i"
-%import "mgmapi/NdbLogEventManager.i"
-
-%{
-
-#include <stdio.h>
-#include <vector>
-
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef VERSION
-
-#include "config.h"
-#include "ndb_init.h"
-#include "storage/ndb/mgmapi/mgmapi.h"
-#include "mgmapi_debug.h"
-#include "listeners.hpp"
-#include "events.hpp"
-
- %}
-
-%include "listeners.hpp"
=== removed file 'storage/ndb/swig/mgmapi/mgmglobals.i'
--- a/storage/ndb/swig/mgmapi/mgmglobals.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/mgmapi/mgmglobals.i 1970-01-01 00:00:00 +0000
@@ -1,455 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-%include "globals.i"
-%include "std_vector.i"
-
-%{
-#include <stdio.h>
-#include <vector>
-
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef VERSION
-
-#include "config.h"
-
-#include "ndb_init.h"
-#include "storage/ndb/mgmapi/mgmapi.h"
-#include "mgmapi_debug.h"
-
-
- %}
-
-%inline %{
-
- enum BackupStartOption {
- DontWait = 0,
- WaitUntilBackupStarted = 1,
- WaitUntilBackupCompleted = 2
- };
-
- %}
-
-%include "ndb_constants.h"
- //%include "ndb_logevent.h"
-
-#define MGM_LOGLEVELS CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1
-#define NDB_MGM_MAX_LOGLEVEL 15
-
-
-
- /**
- * NDB Cluster node types
- */
- // API: 1 MGM: 2 NDB: 0
-%rename ndb_mgm_node_type NodeType;
-enum ndb_mgm_node_type {
- NDB_MGM_NODE_TYPE_UNKNOWN = -1 /** Node type not known*/
- ,NDB_MGM_NODE_TYPE_NDB = NODE_TYPE_DB /** A database node */
- ,NDB_MGM_NODE_TYPE_API = NODE_TYPE_API /** An application (NdbApi) node */
- ,NDB_MGM_NODE_TYPE_MGM = NODE_TYPE_MGM /** A management server node */
-};
-
-/**
- * Database node status
- */
-%rename ndb_mgm_node_status NodeStatus;
-enum ndb_mgm_node_status {
- /** Node status not known*/
- NDB_MGM_NODE_STATUS_UNKNOWN = 0,
- /** No contact with node*/
- NDB_MGM_NODE_STATUS_NO_CONTACT = 1,
- /** Has not run starting protocol*/
- NDB_MGM_NODE_STATUS_NOT_STARTED = 2,
- /** Is running starting protocol*/
- NDB_MGM_NODE_STATUS_STARTING = 3,
- /** Running*/
- NDB_MGM_NODE_STATUS_STARTED = 4,
- /** Is shutting down*/
- NDB_MGM_NODE_STATUS_SHUTTING_DOWN = 5,
- /** Is restarting*/
- NDB_MGM_NODE_STATUS_RESTARTING = 6,
- /** Maintenance mode*/
- NDB_MGM_NODE_STATUS_SINGLEUSER = 7,
- /** Resume mode*/
- NDB_MGM_NODE_STATUS_RESUME = 8,
-};
-
-/**
- * Error codes
- */
-%rename ndb_mgm_error NdbMgmError;
-enum ndb_mgm_error {
- /** Not an error */
- NDB_MGM_NO_ERROR = 0,
-
- /* Request for service errors */
- /** Supplied connectstring is illegal */
- NDB_MGM_ILLEGAL_CONNECT_STRING = 1001,
- /** Supplied NdbMgmHandle is illegal */
- NDB_MGM_ILLEGAL_SERVER_HANDLE = 1005,
- /** Illegal reply from server */
- NDB_MGM_ILLEGAL_SERVER_REPLY = 1006,
- /** Illegal number of nodes */
- NDB_MGM_ILLEGAL_NUMBER_OF_NODES = 1007,
- /** Illegal node status */
- NDB_MGM_ILLEGAL_NODE_STATUS = 1008,
- /** Memory allocation error */
- NDB_MGM_OUT_OF_MEMORY = 1009,
- /** Management server not connected */
- NDB_MGM_SERVER_NOT_CONNECTED = 1010,
- /** Could not connect to socker */
- NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET = 1011,
- /** Could not bind local address */
- NDB_MGM_BIND_ADDRESS = 1012,
-
- /* Alloc node id failures */
- /** Generic error, retry may succeed */
- NDB_MGM_ALLOCID_ERROR = 1101,
- /** Non retriable error */
- NDB_MGM_ALLOCID_CONFIG_MISMATCH = 1102,
-
- /* Service errors - Start/Stop Node or System */
- /** Start failed */
- NDB_MGM_START_FAILED = 2001,
- /** Stop failed */
- NDB_MGM_STOP_FAILED = 2002,
- /** Restart failed */
- NDB_MGM_RESTART_FAILED = 2003,
-
- /* Service errors - Backup */
- /** Unable to start backup */
- NDB_MGM_COULD_NOT_START_BACKUP = 3001,
- /** Unable to abort backup */
- NDB_MGM_COULD_NOT_ABORT_BACKUP = 3002,
-
- /* Service errors - Single User Mode */
- /** Unable to enter single user mode */
- NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
- /** Unable to exit single user mode */
- NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,
-
- /* Usage errors */
- /** Usage error */
- NDB_MGM_USAGE_ERROR = 5001
-};
-
-%rename ndb_mgm_event_severity NdbLogEventSeverity;
-enum ndb_mgm_event_severity {
- NDB_MGM_ILLEGAL_EVENT_SEVERITY = -1,
- /* Must be a nonnegative integer (used for array indexing) */
- /** Cluster log on */
- NDB_MGM_EVENT_SEVERITY_ON = 0,
- /** Used in NDB Cluster developement */
- NDB_MGM_EVENT_SEVERITY_DEBUG = 1,
- /** Informational messages*/
- NDB_MGM_EVENT_SEVERITY_INFO = 2,
- /** Conditions that are not error condition, but might require handling.
- */
- NDB_MGM_EVENT_SEVERITY_WARNING = 3,
- /** Conditions that, while not fatal, should be corrected. */
- NDB_MGM_EVENT_SEVERITY_ERROR = 4,
- /** Critical conditions, like device errors or out of resources */
- NDB_MGM_EVENT_SEVERITY_CRITICAL = 5,
- /** A condition that should be corrected immediately,
- * such as a corrupted system
- */
- NDB_MGM_EVENT_SEVERITY_ALERT = 6,
- /* must be next number, works as bound in loop */
- /** All severities */
- NDB_MGM_EVENT_SEVERITY_ALL = 7
-};
-
-/**
- * Log event categories, used to set filter level on the log events using
- * ndb_mgm_set_clusterlog_loglevel() and ndb_mgm_listen_event()
- */
-%rename ndb_mgm_event_category NdbLogEventCategory;
-enum ndb_mgm_event_category {
- /**
- * Invalid log event category
- */
- NDB_MGM_ILLEGAL_EVENT_CATEGORY = -1,
- /**
- * Log events during all kinds of startups
- */
- NDB_MGM_EVENT_CATEGORY_STARTUP = CFG_LOGLEVEL_STARTUP,
- /**
- * Log events during shutdown
- */
- NDB_MGM_EVENT_CATEGORY_SHUTDOWN = CFG_LOGLEVEL_SHUTDOWN,
- /**
- * Statistics log events
- */
- NDB_MGM_EVENT_CATEGORY_STATISTIC = CFG_LOGLEVEL_STATISTICS,
- /**
- * Log events related to checkpoints
- */
- NDB_MGM_EVENT_CATEGORY_CHECKPOINT = CFG_LOGLEVEL_CHECKPOINT,
- /**
- * Log events during node restart
- */
- NDB_MGM_EVENT_CATEGORY_NODE_RESTART = CFG_LOGLEVEL_NODERESTART,
- /**
- * Log events related to connections between cluster nodes
- */
- NDB_MGM_EVENT_CATEGORY_CONNECTION = CFG_LOGLEVEL_CONNECTION,
- /**
- * Backup related log events
- */
- NDB_MGM_EVENT_CATEGORY_BACKUP = CFG_LOGLEVEL_BACKUP,
- /**
- * Congestion related log events
- */
- NDB_MGM_EVENT_CATEGORY_CONGESTION = CFG_LOGLEVEL_CONGESTION,
- /**
- * Loglevel debug
- */
- NDB_MGM_EVENT_CATEGORY_DEBUG = CFG_LOGLEVEL_DEBUG,
- /**
- * Uncategorized log events (severity info)
- */
- NDB_MGM_EVENT_CATEGORY_INFO = CFG_LOGLEVEL_INFO,
- /**
- * Uncategorized log events (severity warning or higher)
- */
- NDB_MGM_EVENT_CATEGORY_ERROR = CFG_LOGLEVEL_ERROR,
- NDB_MGM_MIN_EVENT_CATEGORY = CFG_MIN_LOGLEVEL,
- NDB_MGM_MAX_EVENT_CATEGORY = CFG_MAX_LOGLEVEL
-
-
-};
-
-
-%rename ndb_mgm_severity NdbMgmSeverity;
-class ndb_mgm_severity {
-public:
- ndb_mgm_event_severity category;
- unsigned int value;
-};
-
-%rename ndb_mgm_loglevel NdbMgmLoglevel;
-class ndb_mgm_loglevel {
-public:
- enum ndb_mgm_event_category category;
- unsigned int value;
-};
-
-%rename Ndb_logevent_type NdbLogEventType;
-enum Ndb_logevent_type {
-
- NDB_LE_ILLEGAL_TYPE = -1,
-
- /** NDB_MGM_EVENT_CATEGORY_CONNECTION */
- NDB_LE_Connected = 0,
- /** NDB_MGM_EVENT_CATEGORY_CONNECTION */
- NDB_LE_Disconnected = 1,
- /** NDB_MGM_EVENT_CATEGORY_CONNECTION */
- NDB_LE_CommunicationClosed = 2,
- /** NDB_MGM_EVENT_CATEGORY_CONNECTION */
- NDB_LE_CommunicationOpened = 3,
- /** NDB_MGM_EVENT_CATEGORY_CONNECTION */
- NDB_LE_ConnectedApiVersion = 51,
-
- /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
- NDB_LE_GlobalCheckpointStarted = 4,
- /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
- NDB_LE_GlobalCheckpointCompleted = 5,
- /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
- NDB_LE_LocalCheckpointStarted = 6,
- /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
- NDB_LE_LocalCheckpointCompleted = 7,
- /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
- NDB_LE_LCPStoppedInCalcKeepGci = 8,
- /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
- NDB_LE_LCPFragmentCompleted = 9,
-
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_NDBStartStarted = 10,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_NDBStartCompleted = 11,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_STTORRYRecieved = 12,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_StartPhaseCompleted = 13,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_CM_REGCONF = 14,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_CM_REGREF = 15,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_FIND_NEIGHBOURS = 16,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_NDBStopStarted = 17,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_NDBStopCompleted = 53,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_NDBStopForced = 59,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_NDBStopAborted = 18,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_StartREDOLog = 19,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_StartLog = 20,
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_UNDORecordsExecuted = 21,
-
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NR_CopyDict = 22,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NR_CopyDistr = 23,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NR_CopyFragsStarted = 24,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NR_CopyFragDone = 25,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NR_CopyFragsCompleted = 26,
-
- /* NODEFAIL */
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NodeFailCompleted = 27,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_NODE_FAILREP = 28,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_ArbitState = 29,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_ArbitResult = 30,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_GCP_TakeoverStarted = 31,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_GCP_TakeoverCompleted = 32,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_LCP_TakeoverStarted = 33,
- /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
- NDB_LE_LCP_TakeoverCompleted = 34,
-
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_TransReportCounters = 35,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_OperationReportCounters = 36,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_TableCreated = 37,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_UndoLogBlocked = 38,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_JobStatistic = 39,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_SendBytesStatistic = 40,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_ReceiveBytesStatistic = 41,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_MemoryUsage = 50,
- /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
- NDB_LE_ThreadConfigLoop = 68,
-
- /** NDB_MGM_EVENT_CATEGORY_ERROR */
- NDB_LE_TransporterError = 42,
- /** NDB_MGM_EVENT_CATEGORY_ERROR */
- NDB_LE_TransporterWarning = 43,
- /** NDB_MGM_EVENT_CATEGORY_ERROR */
- NDB_LE_MissedHeartbeat = 44,
- /** NDB_MGM_EVENT_CATEGORY_ERROR */
- NDB_LE_DeadDueToHeartbeat = 45,
- /** NDB_MGM_EVENT_CATEGORY_ERROR */
- NDB_LE_WarningEvent = 46,
-
- /** NDB_MGM_EVENT_CATEGORY_INFO */
- NDB_LE_SentHeartbeat = 47,
- /** NDB_MGM_EVENT_CATEGORY_INFO */
- NDB_LE_CreateLogBytes = 48,
- /** NDB_MGM_EVENT_CATEGORY_INFO */
- NDB_LE_InfoEvent = 49,
-
- /* 50 used */
- /* 51 used */
-
- /* SINGLE USER */
- NDB_LE_SingleUser = 52,
- /* 53 used */
-
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_BackupStarted = 54,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_BackupFailedToStart = 55,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_BackupStatus = 62,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_BackupCompleted = 56,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_BackupAborted = 57,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_RestoreMetaData = 63,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_RestoreData = 64,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_RestoreLog = 65,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_RestoreStarted = 66,
- /** NDB_MGM_EVENT_CATEGORY_BACKUP */
- NDB_LE_RestoreCompleted = 67,
-
- /** NDB_MGM_EVENT_CATEGORY_INFO */
- NDB_LE_EventBufferStatus = 58,
-
- /* 59 used */
-
- /** NDB_MGM_EVENT_CATEGORY_STARTUP */
- NDB_LE_StartReport = 60
-
- /* 61 (used in upcoming patch) */
- /* 62-68 used */
- /* 69 unused */
-
-};
-
-
-%{
-
- class NdbFilterItem {
-
- public:
- int level;
- ndb_mgm_event_category category;
-
- NdbFilterItem(int level=0,
- ndb_mgm_event_category category=NDB_MGM_ILLEGAL_EVENT_CATEGORY) {
- this->level=level;
- this->category=category;
- }
- };
-
- %}
-
-class NdbFilterItem {
-
-
-public:
- int level;
- ndb_mgm_event_category category;
-
- NdbFilterItem(int level=0,
- ndb_mgm_event_category category=NDB_MGM_ILLEGAL_EVENT_CATEGORY);
-};
-
-%template(NdbFilterList) std::vector<NdbFilterItem>;
=== removed directory 'storage/ndb/swig/ndbapi'
=== removed file 'storage/ndb/swig/ndbapi/Ndb.i'
--- a/storage/ndb/swig/ndbapi/Ndb.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/Ndb.i 1970-01-01 00:00:00 +0000
@@ -1,256 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%delobject Ndb::close;
-%delobject Ndb::closeTransaction;
-
-class Ndb {
-
-public:
- Ndb(Ndb_cluster_connection *ndb_cluster_connection,
- const char* aCatalogName = "", const char* aSchemaName = "def");
- ~Ndb();
-
- %ndbnoexception;
-
- // These are not expected to fail
- const NdbError & getNdbError() const;
- const NdbError & getNdbError(int errorCode);
-
- const char * getDatabaseName() const;
- void setDatabaseName(const char * aDatabaseName);
- const char * getDatabaseSchemaName() const;
- void setDatabaseSchemaName(const char * aDatabaseSchemaName);
-
- void closeTransaction(NdbTransaction*);
-
- NdbEventOperation *nextEvent();
-
- void sendPreparedTransactions(int forceSend = 0);
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
- int dropEventOperation(NdbEventOperation* eventOp);
- int sendPollNdb(int aMillisecondNumber = WAITFOR_RESPONSE_TIMEOUT,
- int minNoOfEventsToWakeup = 1,
- int forceSend = 0);
- int pollNdb(int aMillisecondNumber = WAITFOR_RESPONSE_TIMEOUT,
- int minNoOfEventsToWakeup = 1);
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- class NdbDictDictionary* getDictionary();
- NdbEventOperation* createEventOperation(const char* eventName);
-
-};
-
-%extend Ndb {
-public:
-
-
- %ndbexception("NdbApiException") init {
- $action
- if (result) {
- NDB_exception(NdbApiException,"Cluster not ready");
- }
- }
- int init(int maxNoOfTransactions = 4) {
- /* This is becoming a no-op, since we're forcing it */
- return 0;
- }
-
- %ndbexception("NdbApiException") {
- $action
- if (result==(Uint64)-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception_err(NdbApiException,err.message,err);
-// TODO: Really? There isn't a better way to do this?
-#if defined(SWIGPERL)
- SWIG_croak_null();
-#else
-#if defined(SWIGPHP)
- return;
-#else
- return (Uint64)0;
-#endif //defined(SWIGPHP)
-#endif //defined(SWIGPERL)
- }
- }
- Uint64 getAutoIncrementValue(const char* aTableName,
- Uint32 cacheSize) {
-
- Uint64 id = 0;
- int ret = self->getAutoIncrementValue(aTableName,id,cacheSize);
- if (ret == -1) {
- return (Uint64)-1;
- }
- return id;
- };
- Uint64 getAutoIncrementValue(NdbDictTable * myTable,
- Uint32 cacheSize) {
-
- Uint64 id = 0;
- int ret = self->getAutoIncrementValue(myTable,id,cacheSize);
- if (ret == -1) {
- return (Uint64)-1;
- }
- return id;
- };
- %ndbexception("NdbApiException") {
- $action
- if (result < 0) {
- NdbError err = arg1->getNdbError();
- NDB_exception_err(NdbApiException,err.message,err);
- }
- }
- int pollEvents(int aMillisecondNumber, Uint64 latestGCI=0) {
- return self->pollEvents(aMillisecondNumber,&latestGCI);
-
- }
- %ndbexception("NdbApiException") {
- $action
- if (result == NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
- const NdbEventOperation*
- getGCIEventOperations(Uint32 iter, Uint32 event_types) {
- return self->getGCIEventOperations(&iter,&event_types);
- }
-
- NdbTransaction* startTransaction(const char* aTableName,
- const char * anInputString, size_t len) {
- const NdbDictDictionary *myDict = self->getDictionary();
- const NdbDictTable *myTable = myDict->getTable(aTableName);
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)anInputString;
- keys[0].len=len;
- keys[1].ptr=NULL;
- keys[1].len=0;
- return self->startTransaction(myTable,keys);
- }
- NdbTransaction* startTransaction(const char* aTableName,
- short keyData) {
- const NdbDictDictionary *myDict = self->getDictionary();
- const NdbDictTable *myTable = myDict->getTable(aTableName);
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)&keyData;
- keys[0].len=sizeof(short);
- keys[1].ptr=NULL;
- keys[1].len=0;
-
- return self->startTransaction(myTable,keys);
- }
- NdbTransaction* startTransaction(const char* aTableName,
- Int32 keyData) {
- const NdbDictDictionary *myDict = self->getDictionary();
- const NdbDictTable *myTable = myDict->getTable(aTableName);
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)&keyData;
- keys[0].len=sizeof(Int32);
- keys[1].ptr=NULL;
- keys[1].len=0;
-
- return self->startTransaction(myTable,keys);
- }
- NdbTransaction* startTransaction(const char* aTableName,
- Uint32 keyData) {
- const NdbDictDictionary *myDict = self->getDictionary();
- const NdbDictTable *myTable = myDict->getTable(aTableName);
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)&keyData;
- keys[0].len=sizeof(Uint32);
- keys[1].ptr=NULL;
- keys[1].len=0;
-
- return self->startTransaction(myTable,keys);
- }
- NdbTransaction* startTransaction(const NdbDictTable* table,
- const char * anInputString, size_t len) {
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)anInputString;
- keys[0].len=len;
- keys[1].ptr=NULL;
- keys[1].len=0;
- return self->startTransaction(table,keys);
- }
- NdbTransaction* startTransaction(const NdbDictTable* table,
- short keyData) {
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)&keyData;
- keys[0].len=sizeof(short);
- keys[1].ptr=NULL;
- keys[1].len=0;
-
- return self->startTransaction(table,keys);
- }
- NdbTransaction* startTransaction(const NdbDictTable* table,
- Int32 keyData) {
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)&keyData;
- keys[0].len=sizeof(Int32);
- keys[1].ptr=NULL;
- keys[1].len=0;
-
- return self->startTransaction(table,keys);
- }
- NdbTransaction* startTransaction(const NdbDictTable* table,
- Uint32 keyData) {
-
- Ndb::Key_part_ptr keys[2];
- keys[0].ptr=(const void*)&keyData;
- keys[0].len=sizeof(Uint32);
- keys[1].ptr=NULL;
- keys[1].len=0;
-
- return self->startTransaction(table,keys);
- }
-
- NdbTransaction* startTransaction() {
- return self->startTransaction();
- }
-
- %ndbnoexception;
-
- void close() {
- delete self;
- }
-
-};
-
=== removed file 'storage/ndb/swig/ndbapi/NdbBlob.i'
--- a/storage/ndb/swig/ndbapi/NdbBlob.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbBlob.i 1970-01-01 00:00:00 +0000
@@ -1,138 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbBlob {
-public:
- enum State {
- Idle = 0,
- Prepared = 1,
- Active = 2,
- Closed = 3,
- Invalid = 9
- };
- State getState();
-/* typedef int ActiveHook(NdbBlob* me, char* arg);*/
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException, err.message);
- }
- }
- int getValue(char* BYTE, Uint32 bytes);
-
-#ifdef SWIGPYTHON
- %rename(setVal) setValue(const char* data, Uint32 bytes);
-#endif
-
- int setValue(const char* BYTE, size_t len);
- /* TODO: build the structure for this callback
- int setActiveHook(ActiveHook* activeHook, char* arg);
- */
- int setNull();
- int truncate(Uint64 length = 0);
- int setPos(Uint64 pos);
- int writeData(const char* data, Uint32 bytes);
-
- %ndbexception("NdbErrorNotAvailable") {
- $action
- if (result==NULL) {
- NDB_exception(NdbApiException,"Problem creating NdbError object");
- }
- }
-
- const NdbError& getNdbError() const;
-
- %ndbexception("NdbApiException") {
- $action
- if (result==0) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException, err.message);
- }
- }
-
- const NdbDictColumn* getColumn();
- NdbBlob* blobsFirstBlob();
- NdbBlob* blobsNextBlob();
- %exception;
- static int getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName);
-private:
- NdbBlob();
-};
-
-%extend NdbBlob {
-public:
- // Making this an Int64 instead of a Uint32 so that we can return
- // a -1 on error to wrap this properly in exceptions
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException, err.message);
- }
- }
-
- Int64 readData(char * BYTE, size_t len) {
-
- Uint32 b = len;
- int ret=self->readData((void *)BYTE, b);
- if (ret==-1) {
- return -1;
- }
- return (Int64)b;
- }
-
- %ndbexception("NdbApiException") {
- static int ret = 0;
- $action
- if (ret==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException, err.message);
- }
- }
-
- bool getNull() {
- static int ret;
- self->getNull(ret);
-
- return (ret==0);
-
- }
-
- Uint64 getLength() {
-
- Uint64 OUTPUT=0;
- static int ret=0;
- ret = self->getLength(OUTPUT);
- return OUTPUT;
- }
-
- Uint64 getPos() {
- Uint64 OUTPUT=0;
- static int ret=0;
- ret = self->getPos(OUTPUT);
- return OUTPUT;
- }
-
- %ndbnoexception;
-
-};
=== removed file 'storage/ndb/swig/ndbapi/NdbClusterConnection.i'
--- a/storage/ndb/swig/ndbapi/NdbClusterConnection.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbClusterConnection.i 1970-01-01 00:00:00 +0000
@@ -1,167 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class Ndb_cluster_connection {
-
-public:
-
- // NdbFactory.getNdbClusterConnection should be used instead
- Ndb_cluster_connection(const char * connectstring = 0);
-
-#if !defined(SWIG_RUBY_AUTORENAME)
- %rename set_name setName;
- %rename wait_until_ready waitUntilReady;
- %rename set_timeout setTimeout;
-#endif
-
- %ndbnoexception;
-
- void set_name(const char* name);
-
- %ndbexception("NdbApiException") {
- $action
- if (result > 0) {
- const char * msg = "Setting timeout failed";
- NDB_exception(NdbApiException,msg);
- }
- }
-
- voidint set_timeout(int timeout_ms);
-
-
- %ndbexception("NdbClusterConnectionPermanentException,"
- "NdbClusterConnectionTemporaryException") {
- $action
- if (result > 0) {
- const char * msg = "Connect to management server failed";
- NDB_exception(NdbClusterConnectionPermanentException,msg);
- } else if (result < 0) {
- const char * msg = "Connect to management server failed";
- NDB_exception(NdbClusterConnectionTemporaryException,msg);
- }
- }
- %typemap(check) int retry_delay_in_seconds {
- if ($1 < 0) {
- NDB_exception(NdbClusterConnectionPermanentException,
- "Delay must be greater than or equal to zero.");
- }
- }
- int connect(int no_retries=0, int retry_delay_in_seconds=1,
- bool verbose=false);
-
- %ndbexception("NdbApiException") {
- $action
- if (result) {
- const char * msg = "Cluster was not ready";
- NDB_exception(NdbApiException,msg);
- }
- }
-
- int wait_until_ready(int timeoutFor_firstAlive,
- int timeoutAfterFirstAlive);
-
-};
-
-%newobject Ndb_cluster_connection::createNdb;
-%typemap(newfree) Ndb * "delete $1;";
-%delobject Ndb_cluster_connection::close;
-
-%extend Ndb_cluster_connection {
-
- %ndbnoexception;
-
- bool close() {
- delete self;
- return true;
- }
-
- void deleteAllNdbObjects() {
-
- const Ndb * tmpNdb = NULL;
-
- self->lock_ndb_objects();
-
- tmpNdb = self->get_next_ndb_object(NULL);
- while (tmpNdb != NULL) {
- const Ndb * delNdb = tmpNdb;
- tmpNdb = self->get_next_ndb_object(tmpNdb);
- delete delNdb;
- }
-
- tmpNdb = NULL;
-
- // Leave Ndb objects locked until we delete the mutex
- delete self;
-
- }
-
-public:
- %ndbexception("NdbApiException") createNdb {
- $action
- if (result==NULL) {
- NDB_exception(NdbApiException,"Couldn't allocate an Ndb object");
- }
- }
-
- %contract createNdb(const char* aCatalogName, const char* aSchemaName,
- Int32 initThreads) {
-require:
- initThreads > 0;
- }
- Ndb* createNdb(const char* aCatalogName="", const char* aSchemaName="def",
- Int32 initThreads = 4) {
- Ndb * theNdb = new Ndb(self,aCatalogName,aSchemaName);
- if (theNdb!=NULL) {
- int ret = theNdb->init(initThreads);
- if ( ret ) {
- delete theNdb;
- return NULL;
- }
- }
- return theNdb;
- }
-
- %contract createNdb(const char* aCatalogName, Int32 initThreads) {
-require:
- initThreads > 0;
- }
- Ndb* createNdb(const char* aCatalogName, Int32 initThreads = 4) {
- Ndb * theNdb = new Ndb(self,aCatalogName);
- if (theNdb!=NULL) {
- int ret = theNdb->init(initThreads);
- if ( ret ) {
- delete theNdb;
- return NULL;
- }
- }
- return theNdb;
- }
-
- %ndbexception("NdbApiException") {
- $action
- if (result) {
- const char * msg = "Cluster was not ready";
- NDB_exception(NdbApiException,msg);
- }
- }
-
- %ndbnoexception;
-
-}
=== removed file 'storage/ndb/swig/ndbapi/NdbDictionary.i'
--- a/storage/ndb/swig/ndbapi/NdbDictionary.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbDictionary.i 1970-01-01 00:00:00 +0000
@@ -1,575 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbDictObject {
-public:
-
- enum Status {
- New, ///< The object only exist in memory and
- ///< has not been created in the NDB Kernel
- Changed, ///< The object has been modified in memory
- ///< and has to be commited in NDB Kernel for
- ///< changes to take effect
- Retrieved, ///< The object exist and has been read
- ///< into main memory from NDB Kernel
- Invalid, ///< The object has been invalidated
- ///< and should not be used
- Altered ///< Table has been altered in NDB kernel
- ///< but is still valid for usage
- };
-
-
-
- enum Type {
- TypeUndefined = 0, ///< Undefined
- SystemTable = 1, ///< System table
- UserTable = 2, ///< User table (may be temporary)
- UniqueHashIndex = 3, ///< Unique un-ordered hash index
- OrderedIndex = 6, ///< Non-unique ordered index
- HashIndexTrigger = 7, ///< NdbDictionary::Index maintenance, internal
- IndexTrigger = 8, ///< NdbDictionary::Index maintenance, internal
- SubscriptionTrigger = 9,///< Backup or replication, internal
- ReadOnlyConstraint = 10 ///< Trigger, internal
- };
-
- enum State {
- StateUndefined = 0, ///< Undefined
- StateOffline = 1, ///< Offline, not usable
- StateBuilding = 2, ///< Building, not yet usable
- StateDropping = 3, ///< Offlining or dropping, not usable
- StateOnline = 4, ///< Online, usable
- StateBackup = 5, ///< Online, being backuped, usable
- StateBroken = 9 ///< Broken, should be dropped and re-created
- };
-
- enum Store {
- StoreUndefined = 0, ///< Undefined
- StoreNotLogged = 1, ///< Object or data deleted on system restart
- StorePermanent = 2 ///< Permanent. logged to disk
- };
-
- enum FragmentType {
- FragUndefined = 0, ///< Fragmentation type undefined or default
- FragSingle = 1, ///< Only one fragment
- FragAllSmall = 2, ///< One fragment per node, default
- FragAllMedium = 3, ///< two fragments per node
- FragAllLarge = 4, ///< Four fragments per node.
- DistrKeyHash = 5,
- DistrKeyLin = 6,
- UserDefined = 7
- };
-
- virtual NdbDictObject::Status getObjectStatus() const = 0;
-
- virtual int getObjectVersion() const = 0;
-
- virtual int getObjectId() const = 0;
-
-};
-
-
-class NdbDictTable; // forward declaration
-
-class NdbDictColumn {
-public:
- enum Type {
- Undefined = NDB_TYPE_UNDEFINED,
- Tinyint = NDB_TYPE_TINYINT,
- Tinyunsigned = NDB_TYPE_TINYUNSIGNED,
- Smallint = NDB_TYPE_SMALLINT,
- Smallunsigned = NDB_TYPE_SMALLUNSIGNED,
- Mediumint = NDB_TYPE_MEDIUMINT,
- Mediumunsigned = NDB_TYPE_MEDIUMUNSIGNED,
- Int = NDB_TYPE_INT,
- Unsigned = NDB_TYPE_UNSIGNED,
- Bigint = NDB_TYPE_BIGINT,
- Bigunsigned = NDB_TYPE_BIGUNSIGNED,
- Float = NDB_TYPE_FLOAT,
- Double = NDB_TYPE_DOUBLE,
- Olddecimal = NDB_TYPE_OLDDECIMAL,
- Olddecimalunsigned = NDB_TYPE_OLDDECIMALUNSIGNED,
- Decimal = NDB_TYPE_DECIMAL,
- Decimalunsigned = NDB_TYPE_DECIMALUNSIGNED,
- Char = NDB_TYPE_CHAR,
- Varchar = NDB_TYPE_VARCHAR,
- Binary = NDB_TYPE_BINARY,
- Varbinary = NDB_TYPE_VARBINARY,
- Datetime = NDB_TYPE_DATETIME,
- Date = NDB_TYPE_DATE,
- Blob = NDB_TYPE_BLOB,
- Text = NDB_TYPE_TEXT,
- Bit = NDB_TYPE_BIT,
- Longvarchar = NDB_TYPE_LONGVARCHAR,
- Longvarbinary = NDB_TYPE_LONGVARBINARY,
- Time = NDB_TYPE_TIME,
- Year = NDB_TYPE_YEAR,
- Timestamp = NDB_TYPE_TIMESTAMP
- };
- const char* getName() const;
- bool getNullable() const;
- bool getPrimaryKey() const;
- int getColumnNo() const;
- bool equal(const NdbDictColumn& column) const;
- Type getType() const;
- int getPrecision() const;
- int getScale() const;
- int getLength() const;
-// CHARSET_INFO* getCharset() const;
- int getInlineSize() const;
- int getPartSize() const;
- int getStripeSize() const;
- int getSize() const;
- bool getPartitionKey() const;
- NdbDictColumn(const char * name = "");
- NdbDictColumn(const NdbDictColumn& column);
- ~NdbDictColumn();
- void setName(const char * name);
- void setNullable(bool);
- void setPrimaryKey(bool);
- void setType(Type type);
- void setPrecision(int);
- void setScale(int);
- void setLength(int length);
-// TODO: CHARSET_INFO
-// void setCharset(CHARSET_INFO* cs);
- void setInlineSize(int size);
- void setPartSize(int size);
- void setStripeSize(int size);
- void setPartitionKey(bool enable);
- const NdbDictTable * getBlobTable() const;
-
- void setAutoIncrement(bool);
- bool getAutoIncrement() const;
- void setAutoIncrementInitialValue(Uint64 val);
- void setDefaultValue(const char*);
- const char* getDefaultValue() const;
-
-#if defined(MYSQL_50)
- // The problem here is actually a Python issue, but this clears it
- // for the moment
- // <FIXME>
- static const NdbDictColumn * FRAGMENT;
- static const NdbDictColumn * FRAGMENT_MEMORY;
- static const NdbDictColumn * ROW_COUNT;
- static const NdbDictColumn * COMMIT_COUNT;
- static const NdbDictColumn * ROW_SIZE;
- static const NdbDictColumn * RANGE_NO;
-#endif
-
- int getSizeInBytes() const;
-};
-
-%extend NdbDictColumn {
-public:
- const char * getCharsetName() {
- const CHARSET_INFO * csinfo = self->getCharset();
- return csinfo->csname;
- }
- Uint32 getCharsetNumber() {
- const CHARSET_INFO * csinfo = self->getCharset();
- return csinfo->number;
- }
-}
-
-typedef NdbDictColumn Attribute;
-
-class NdbDictTable : public NdbDictObject {
-public:
- const char * getName() const;
- int getTableId() const;
- NdbDictColumn* getColumn(const int attributeId);
- NdbDictColumn* getColumn(const char * name);
- bool getLogging() const;
- NdbDictObject::FragmentType getFragmentType() const;
- int getKValue() const;
- int getMinLoadFactor() const;
- int getMaxLoadFactor() const;
- int getNoOfColumns() const;
- int getNoOfPrimaryKeys() const;
- const char* getPrimaryKey(int no) const;
- bool equal(const NdbDictTable&) const;
-/* There is really no need to expose these */
-// const void* getFrmData() const;
-// Uint32 getFrmLength() const;
-// void setFrm(const void* data, Uint32 len);
- NdbDictTable(const char * name = "");
- NdbDictTable(const NdbDictTable& table);
- virtual ~Table();
- //NdbDictTable& operator=(const NdbDictTable& table);
- void setName(const char * name);
- void addColumn(const NdbDictColumn &);
- void setLogging(bool);
- void setFragmentType(NdbDictObject::FragmentType);
- void setKValue(int kValue);
- void setMinLoadFactor(int);
- void setMaxLoadFactor(int);
- virtual NdbDictObject::Status getObjectStatus() const;
- virtual int getObjectVersion() const;
-// TODO: This is not definied in libndbclient.so but is in the .hpp file
-// void setObjectType(NdbDictObject::Type type);
-// NdbDictObject::Type getObjectType() const;
- void setMaxRows(Uint64 maxRows);
- Uint64 getMaxRows() const;
- void setMinRows(Uint64 minRows);
- Uint64 getMinRows() const;
- int getRowSizeInBytes() const ;
- int createTableInDb(Ndb*, bool existingEqualIsOk = true) const ;
- int getReplicaCount() const ;
-};
-
-class NdbDictIndex : public NdbDictObject {
-public:
-
- enum Type {
- Undefined = 0, ///< Undefined object type (initial value)
- UniqueHashIndex = 3, ///< Unique un-ordered hash index
- ///< (only one currently supported)
- OrderedIndex = 6 ///< Non-unique ordered index
- };
-
- %ndbexception("NdbApiException") {
- $action
- if (result==0) {
- NDB_exception(NdbApiException,"NdbDictionary::Index Error");
- }
- }
-
- const char * getName() const;
- const char * getTable() const;
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NDB_exception(NdbApiException,"NdbDictionary::Index Error");
- }
- }
-
- const NdbDictColumn * getColumn(unsigned no) const ;
-
- %ndbnoexception;
-
- virtual int getObjectVersion() const;
-
- Type getType() const;
- virtual NdbDictObject::Status getObjectStatus() const;
-
- bool getLogging() const;
- unsigned getNoOfColumns() const;
- NdbDictIndex(const char * name = "");
- virtual ~NdbDictIndex();
-
- void setName(const char * name);
- void setTable(const char * name);
- void addColumn(const NdbDictColumn & c);
- void addColumnName(const char * name);
- void addColumnNames(unsigned noOfNames, const char ** names);
- void setType(Type type);
- void setLogging(bool enable);
-};
-
-class NdbDictDictionary {
-public:
-#if 0
-// Protect swig from this nested class until we redefine it
- /**
- * @class List
- * @brief Structure for retrieving lists of object names
- */
- struct List {
- /**
- * @struct Element
- * @brief NdbDictObject to be stored in an NdbDictDictList
- */
- struct Element {
- unsigned id; ///< Id of object
- NdbDictObject::Type type; ///< Type of object
- NdbDictObject::State state; ///< State of object
- NdbDictObject::Store store; ///< How object is stored
- char * database; ///< In what database the object resides
- char * schema; ///< What schema the object is defined in
- char * name; ///< Name of object
- Element() :
- id(0),
- type(NdbDictObject::TypeUndefined),
- state(NdbDictObject::StateUndefined),
- store(NdbDictObject::StoreUndefined),
- database(0),
- schema(0),
- name(0) {
- }
- };
- unsigned count; ///< Number of elements in list
- Element * elements; ///< Pointer to array of elements
- List() : count(0), elements(0) {}
- ~List() {
- if (elements != 0) {
- for (unsigned i = 0; i < count; i++) {
- delete[] elements[i].database;
- delete[] elements[i].schema;
- delete[] elements[i].name;
- elements[i].name = 0;
- }
- delete[] elements;
- count = 0;
- elements = 0;
- }
- }
- };
-
- int listObjects(List & list,
- NdbDictObject::Type type = NdbDictObject::TypeUndefined);
- int listObjects(List & list,
- NdbDictObject::Type type = NdbDictObject::TypeUndefined) const;
- int listIndexes(List & list, const char * tableName);
- int listIndexes(List & list, const char * tableName) const;
-
-#endif
-
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- const NdbDictTable * getTable(const char * name) const;
- const NdbDictIndex * getIndex(const char * indexName,
- const char * tableName) const;
- const NdbDictEvent * getEvent(const char * eventName);
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- int createEvent(const NdbDictEvent &event);
- int dropEvent(const char * eventName);
- int createTable(const NdbDictTable &table);
- int dropTable(NdbDictTable & table);
- int dropTable(const char * name);
- int createIndex(const NdbDictIndex &index);
- int dropIndex(const char * indexName,
- const char * tableName);
-#if defined(MYSQL_50)
- int dropIndex(const NdbDictIndex &);
-#endif
-
- %ndbnoexception;
-
- const struct NdbError & getNdbError() const;
-
- void invalidateTable(const char * name);
- void removeCachedTable(const char * table);
- void removeCachedIndex(const char * index, const char * table);
- void invalidateIndex(const char * indexName,
- const char * tableName);
-private:
- NdbDictDictionary();
- ~NdbDictDictionary();
-};
-
-
-class NdbDictEvent : public NdbDictObject {
-
-public:
- enum TableEvent {
- TE_INSERT =1<<0, ///< Insert event on table
- TE_DELETE =1<<1, ///< Delete event on table
- TE_UPDATE =1<<2, ///< Update event on table
- TE_DROP =1<<4, ///< Drop of table
- TE_ALTER =1<<5, ///< Alter of table
- TE_CREATE =1<<6, ///< Create of table
- TE_GCP_COMPLETE=1<<7, ///< GCP is complete
- TE_CLUSTER_FAILURE=1<<8, ///< Cluster is unavailable
- TE_STOP =1<<9, ///< Stop of event operation
- TE_NODE_FAILURE=1<<10, ///< Node failed
- TE_SUBSCRIBE =1<<11, ///< Node subscribes
- TE_UNSUBSCRIBE =1<<12, ///< Node unsubscribes
- TE_ALL=0xFFFF ///< Any/all event on table (not relevant when
- ///< events are received)
- };
-
- enum EventDurability {
- ED_UNDEFINED = 0,
- ED_PERMANENT = 3,
- };
-
- /**
- * Specifies reporting options for table events
- */
- enum EventReport {
- ER_UPDATED = 0,
- ER_ALL = 1, // except not-updated blob inlines
- ER_SUBSCRIBE = 2
- };
-
- /**
- * Constructor
- * @param name Name of event
- */
- NdbDictEvent(const char *name);
- /**
- * Constructor
- * @param name Name of event
- * @param table Reference retrieved from NdbDictionary
- */
- NdbDictEvent(const char *name, const NdbDictTable& table);
- virtual ~Event();
- /**
- * Set unique identifier for the event
- */
- int setName(const char *name);
- /**
- * Get unique identifier for the event
- */
- const char *getName() const;
- /**
- * Get table that the event is defined on
- *
- * @return pointer to table or NULL if no table has been defined
- */
- const NdbDictTable * getTable() const;
- /**
- * Define table on which events should be detected
- *
- * @note calling this method will default to detection
- * of events on all columns. Calling subsequent
- * addEventColumn calls will override this.
- *
- * @param table reference retrieved from NdbDictionary
- */
- void setTable(const NdbDictTable& table);
- /**
- * Set table for which events should be detected
- *
- * @note preferred way is using setTable(const NdbDictionary::Table&)
- * or constructor with table object parameter
- */
- int setTable(const char *tableName);
- /**
- * Get table name for events
- *
- * @return table name
- */
- const char* getTableName() const;
- /**
- * Add type of event that should be detected
- */
- void addTableEvent(const TableEvent te);
- /**
- * Check if a specific table event will be detected
- */
- bool getTableEvent(const TableEvent te) const;
- /**
- * Set durability of the event
- */
- void setDurability(EventDurability);
- /**
- * Get durability of the event
- */
- EventDurability getDurability() const;
- /**
- * Set report option of the event
- */
- void setReport(EventReport);
- /**
- * Get report option of the event
- */
- EventReport getReport() const;
-
- /**
- * Add a column on which events should be detected
- *
- * @param attrId Column id
- *
- * @note errors will mot be detected until createEvent() is called
- */
- void addEventColumn(unsigned attrId);
- /**
- * Add a column on which events should be detected
- *
- * @param columnName Column name
- *
- * @note errors will not be detected until createEvent() is called
- */
- void addEventColumn(const char * columnName);
- /**
- * Add several columns on which events should be detected
- *
- * @param n Number of columns
- * @param columnNames Column names
- *
- * @note errors will mot be detected until
- * NdbDictionary::Dictionary::createEvent() is called
- */
- void addEventColumns(unsigned noOfNames, const char ** names);
-
- /**
- * Get no of columns defined in an Event
- *
- * @return Number of columns, -1 on error
- */
- int getNoOfEventColumns() const;
-
- /**
- * Get a specific column in the event
- */
- const NdbDictColumn * getEventColumn(unsigned no) const;
-
- /**
- * The merge events flag is false by default. Setting it true
- * implies that events are merged in following ways:
- *
- * - for given NdbEventOperation associated with this event,
- * events on same PK within same GCI are merged into single event
- *
- * - a blob table event is created for each blob attribute
- * and blob events are handled as part of main table events
- *
- * - blob post/pre data from the blob part events can be read
- * via NdbBlob methods as a single value
- *
- * NOTE: Currently this flag is not inherited by NdbEventOperation
- * and must be set on NdbEventOperation explicitly.
- */
- void mergeEvents(bool flag);
-
- /**
- * Get object status
- */
- virtual NdbDictObject::Status getObjectStatus() const;
-
- /**
- * Get object version
- */
- virtual int getObjectVersion() const;
-
- /**
- * Get object id
- */
- virtual int getObjectId() const;
-private:
- Event(NdbEventImpl&);
-};
=== removed file 'storage/ndb/swig/ndbapi/NdbError.i'
--- a/storage/ndb/swig/ndbapi/NdbError.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbError.i 1970-01-01 00:00:00 +0000
@@ -1,237 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbError {
-
-public:
- /**
- * Status categorizes error codes into status values reflecting
- * what the application should do when encountering errors
- */
- enum Status {
- /**
- * The error code indicate success<br>
- * (Includes classification: NdbError::NoError)
- */
- Success = ndberror_st_success,
-
- /**
- * The error code indicates a temporary error.
- * The application should typically retry.<br>
- * (Includes classifications: NdbError::InsufficientSpace,
- * NdbError::TemporaryResourceError, NdbError::NodeRecoveryError,
- * NdbError::OverloadError, NdbError::NodeShutdown
- * and NdbError::TimeoutExpired.)
- */
- TemporaryError = ndberror_st_temporary,
-
- /**
- * The error code indicates a permanent error.<br>
- * (Includes classificatons: NdbError::PermanentError,
- * NdbError::ApplicationError, NdbError::NoDataFound,
- * NdbError::ConstraintViolation, NdbError::SchemaError,
- * NdbError::UserDefinedError, NdbError::InternalError, and,
- * NdbError::FunctionNotImplemented.)
- */
- PermanentError = ndberror_st_permanent,
-
- /**
- * The result/status is unknown.<br>
- * (Includes classifications: NdbError::UnknownResultError, and
- * NdbError::UnknownErrorCode.)
- */
- UnknownResult = ndberror_st_unknown
- };
-
- /**
- * Type of error
- */
- enum Classification {
- /**
- * Success. No error occurred.
- */
- NoError = ndberror_cl_none,
-
- /**
- * Error in application program.
- */
- ApplicationError = ndberror_cl_application,
-
- /**
- * Read operation failed due to missing record.
- */
- NoDataFound = ndberror_cl_no_data_found,
-
- /**
- * E.g. inserting a tuple with a primary key already existing
- * in the table.
- */
- ConstraintViolation = ndberror_cl_constraint_violation,
-
- /**
- * Error in creating table or usage of table.
- */
- SchemaError = ndberror_cl_schema_error,
-
- /**
- * Error occurred in interpreted program.
- */
- UserDefinedError = ndberror_cl_user_defined,
-
- /**
- * E.g. insufficient memory for data or indexes.
- */
- InsufficientSpace = ndberror_cl_insufficient_space,
-
- /**
- * E.g. too many active transactions.
- */
- TemporaryResourceError = ndberror_cl_temporary_resource,
-
- /**
- * Temporary failures which are probably inflicted by a node
- * recovery in progress. Examples: information sent between
- * application and NDB lost, distribution change.
- */
- NodeRecoveryError = ndberror_cl_node_recovery,
-
- /**
- * E.g. out of log file space.
- */
- OverloadError = ndberror_cl_overload,
-
- /**
- * Timeouts, often inflicted by deadlocks in NDB.
- */
- TimeoutExpired = ndberror_cl_timeout_expired,
-
- /**
- * Is is unknown whether the transaction was committed or not.
- */
- UnknownResultError = ndberror_cl_unknown_result,
-
- /**
- * A serious error in NDB has occurred.
- */
- InternalError = ndberror_cl_internal_error,
-
- /**
- * A function used is not yet implemented.
- */
- FunctionNotImplemented = ndberror_cl_function_not_implemented,
-
- /**
- * Error handler could not determine correct error code.
- */
- UnknownErrorCode = ndberror_cl_unknown_error_code,
-
- /**
- * Node shutdown
- */
- NodeShutdown = ndberror_cl_node_shutdown,
-
- /**
- * Schema object already exists
- */
- SchemaObjectExists = ndberror_cl_schema_object_already_exists,
-
- /**
- * Request sent to non master
- */
- InternalTemporary = ndberror_cl_internal_temporary
- };
-
-private:
- /**
- * Error status.
- */
- Status status;
-
- /**
- * Error type
- */
- Classification classification;
-
- /**
- * Error code
- */
- int code;
-
- /**
- * Mysql error code
- */
- int mysql_code;
-
- /**
- * Error message
- */
- const char * message;
- /**
- * The detailed description. This is extra information regarding the
- * error which is not included in the error message.
- *
- * @note Is NULL when no details specified
- */
- char * details;
-
-
- NdbError(){
- status = UnknownResult;
- classification = NoError;
- code = 0;
- mysql_code = 0;
- message = 0;
- details = 0;
- }
- NdbError(const ndberror_struct & ndberror){
- status = (NdbError::Status) ndberror.status;
- classification = (NdbError::Classification) ndberror.classification;
- code = ndberror.code;
- mysql_code = ndberror.mysql_code;
- message = ndberror.message;
- details = ndberror.details;
- }
- operator ndberror_struct() const {
- ndberror_struct ndberror;
- ndberror.status = (ndberror_status_enum) status;
- ndberror.classification = (ndberror_classification_enum) classification;
- ndberror.code = code;
- ndberror.mysql_code = mysql_code;
- ndberror.message = message;
- ndberror.details = details;
- return ndberror;
- }
-
-};
-
-%extend NdbError {
- const char * getMessage() {
- return self->message;
- }
- int getCode() {
- return self->code;
- }
- Classification getClassification() {
- return self->classification;
- }
- Status getStatus() {
- return self->status;
- }
-}
=== removed file 'storage/ndb/swig/ndbapi/NdbEventOperation.i'
--- a/storage/ndb/swig/ndbapi/NdbEventOperation.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbEventOperation.i 1970-01-01 00:00:00 +0000
@@ -1,179 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbEventOperation {
-
-private:
-
- NdbEventOperation(Ndb *theNdb, const char* eventName);
- ~NdbEventOperation();
-
-public:
- /**
- * State of the NdbEventOperation object
- */
- enum State {
- EO_CREATED, ///< Created but execute() not called
- EO_EXECUTING, ///< execute() called
- EO_DROPPED, ///< Waiting to be deleted, Object unusable.
- EO_ERROR ///< An error has occurred. Object unusable.
- };
-
-
- %ndbnoexception;
-
- /**
- * Get the latest error
- *
- * @return Error object.
- */
- const struct NdbError & getNdbError() const;
-
- bool isConsistent() const;
-
- /**
- * Check if table name has changed, for event TE_ALTER
- */
- const bool tableNameChanged() const;
-
- /**
- * Check if table frm has changed, for event TE_ALTER
- */
- const bool tableFrmChanged() const;
-
- /**
- * Check if table fragmentation has changed, for event TE_ALTER
- */
- const bool tableFragmentationChanged() const;
-
- /**
- * Check if table range partition list name has changed, for event TE_ALTER
- */
- const bool tableRangeListChanged() const;
-
- /**
- * Retrieve the GCI of the latest retrieved event
- *
- * @return GCI number
- */
- Uint64 getGCI() const;
-
- /**
- * Retrieve the AnyValue of the latest retrieved event
- *
- * @return AnyValue
- */
- Uint32 getAnyValue() const;
- /**
- * Retrieve the complete GCI in the cluster (not necessarily
- * associated with an event)
- *
- * @return GCI number
- */
- Uint64 getLatestGCI() const;
-
- /**
- * Retrieve current state of the NdbEventOperation object
- */
- State getState();
-
-
- /**
- * See NdbDictionary::Event. Default is false.
- */
- void mergeEvents(bool flag);
-
- /**
- * Query for occured event type.
- *
- * @note Only valid after Ndb::nextEvent() has been called and
- * returned a not NULL value
- *
- * @return type of event
- */
- NdbDictEvent::TableEvent getEventType() const;
-
-
- /* methods that return an object */
- %ndbexception("NdbApiException") {
- $action
- if (result == NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- /**
- * See getValue().
- */
- NdbBlob* getBlobHandle(const char *anAttrName);
- NdbBlob* getPreBlobHandle(const char *anAttrName);
-
-
-
- /* methods that return an object */
- %ndbexception("NdbApiException") {
- $action
- if (result == -1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- /**
- * Activates the NdbEventOperation to start receiving events. The
- * changed attribute values may be retrieved after Ndb::nextEvent()
- * has returned not NULL. The getValue() methods must be called
- * prior to execute().
- *
- * @return 0 if successful otherwise -1.
- */
- int execute();
-
- int isOverrun() const;
-
- %ndbnoexception;
-
-};
-
-typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
-
-%extend NdbEventOperation {
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- NdbRecAttr* getValue(const char* anAttrName) {
- return self->getValue(anAttrName,NULL);
- }
-
-
- NdbRecAttr* getPreValue(const char *anAttrName) {
- return self->getPreValue(anAttrName, NULL);
- }
-
- %ndbnoexception;
-
-};
=== removed file 'storage/ndb/swig/ndbapi/NdbFactory.i'
--- a/storage/ndb/swig/ndbapi/NdbFactory.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbFactory.i 1970-01-01 00:00:00 +0000
@@ -1,98 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%newobject NdbFactory::createNdbClusterConnection;
-%typemap(newfree) Ndb_cluster_connection * "delete $1;";
-
-%{
-
- class NdbFactory
- {
-
- public:
- static Ndb_cluster_connection * createNdbClusterConnection(const char * connectString = 0)
- {
- Ndb_cluster_connection * theConnection = NULL;
- if (connectString == 0) {
- theConnection = new Ndb_cluster_connection();
- } else {
- theConnection = new Ndb_cluster_connection(connectString);
- }
- return theConnection;
- }
-
- static Ndb * createNdb(Ndb_cluster_connection * theConn,const char* aCatalogName="", const char* aSchemaName="def") {
- return new Ndb(theConn,aCatalogName,aSchemaName);
- }
-
- static NdbTransaction * createTransaction(Ndb * theNdb, const NdbDictTable *table= 0,
- const char *keyData = 0,
- Uint32 keyLen = 0) {
- return theNdb->startTransaction(table,keyData,keyLen);
- }
-
- static NdbTransaction* createTransaction(Ndb * theNdb,
- const char* aTableName,
- const char *keyData) {
- const NdbDictDictionary *myDict = theNdb->getDictionary();
- const NdbDictTable *myTable = myDict->getTable(aTableName);
- return theNdb->startTransaction(myTable,keyData);
- }
- static NdbTransaction* createTransaction(Ndb * theNdb,
- const char* aTableName,
- int keyData) {
- const NdbDictDictionary *myDict = theNdb->getDictionary();
- const NdbDictTable *myTable = myDict->getTable(aTableName);
- return theNdb->startTransaction(myTable,(const char *) &keyData);
- }
-
-
- };
-
- %}
-
-
-class NdbFactory
-{
- // We list these here as private so that SWIG doesnt generate them
- NdbFactory();
- ~NdbFactory();
-public:
-
- %ndbexception("NdbApiException") {
-
- $action
- if (result==NULL) {
- NDB_exception(NdbApiException,"Couldn't allocate object");
- }
- }
- static Ndb_cluster_connection * createNdbClusterConnection(const char * connectString = 0);
- static Ndb * createNdb(Ndb_cluster_connection * theConn,const char* aCatalogName="", const char* aSchemaName="def");
- static NdbTransaction * createTransaction(Ndb * theNdb, const NdbDictTable *table= 0,
- const char *keyData = 0,
- Uint32 keyLen = 0);
- static NdbTransaction* createTransaction(Ndb * theNdb,
- const char* aTableName,
- const char *keyData);
- static NdbTransaction* createTransaction(Ndb * theNdb,
- const char* aTableName,
- int keyData);
-
-};
=== removed file 'storage/ndb/swig/ndbapi/NdbIndexOperation.i'
--- a/storage/ndb/swig/ndbapi/NdbIndexOperation.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbIndexOperation.i 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbIndexOperation : public NdbOperation {
-
-private:
- NdbIndexOperation(Ndb* aNdb);
- ~NdbIndexOperation();
-
-public:
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- voidint readTuple(LockMode);
- voidint updateTuple();
- voidint deleteTuple();
-
- voidint interpretedUpdateTuple();
- voidint interpretedDeleteTuple();
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
- const NdbDictIndex * getIndex() const;
-
- %ndbnoexception;
-
-};
=== removed file 'storage/ndb/swig/ndbapi/NdbIndexScanOperation.i'
--- a/storage/ndb/swig/ndbapi/NdbIndexScanOperation.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbIndexScanOperation.i 1970-01-01 00:00:00 +0000
@@ -1,666 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbIndexScanOperation : public NdbScanOperation {
-
- NdbIndexScanOperation(Ndb* aNdb);
- virtual ~NdbIndexScanOperation();
-
-public:
-
- enum BoundType {
- BoundLE = 0,
- BoundLT = 1,
- BoundGE = 2,
- BoundGT = 3,
- BoundEQ = 4
- };
-
- %ndbnoexception
-
- bool getSorted() const;
- bool getDescending();
-
- %ndbexception("NdbApiException") {
- $action
- if (result == -1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
-#if !defined(SWIG_RUBY_AUTORENAME)
- %rename reset_bounds resetBounds;
- %rename end_of_bound endOfBound;
- %rename get_range_no getRangeNo;
-#endif
-
- voidint reset_bounds(bool forceSend = false);
- voidint end_of_bound(Uint32 range_no);
- voidint get_range_no();
-
- virtual voidint readTuples(NdbOperation::LockMode lock_mode = LM_Read,
- Uint32 scan_flags = 0,
- Uint32 parallel = 0,
- Uint32 batch = 0);
-
- virtual voidint readTuples(LockMode lock_mode,
- Uint32 batch,
- Uint32 parallel,
- bool order_by,
- bool order_desc = false,
- bool read_range_no = false,
- bool keyinfo = false,
- bool multi_range = false);
-
-};
-
-%extend NdbIndexScanOperation {
-
-public:
- %ndbexception("NdbApiException") {
- $action
- if (result == -1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- voidint setBoundNull(const char* anAttrName, BoundType type) {
- return self->setBound(anAttrName,type,(void *)0);
- };
- voidint setBoundNull(Uint32 anAttrId, BoundType type) {
- return self->setBound(anAttrId,type,(void *)0);
- };
-
- voidint setBoundInt(const char* anAttrName, BoundType type,
- const Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- voidint setBoundInt(Uint32 anAttrId, BoundType type,
- const Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-
- voidint setBoundLong(const char* anAttrName, BoundType type,
- const Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- voidint setBoundLong(Uint32 anAttrId, BoundType type,
- const Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-
- voidint setBoundUlong(const char* anAttrName, BoundType type,
- const Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- voidint setBoundUlong(Uint32 anAttrId, BoundType type,
- const Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-
- voidint setBoundDouble(const char* anAttrName, BoundType type,
- const double val) {
- double value = (double)val;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- voidint setBoundDouble(Uint32 anAttrId, BoundType type,
- const double val) {
- double value = (double)val;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-
- voidint setBoundFloat(const char* anAttrName, BoundType type,
- const float val) {
- float value = (float)val;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- voidint setBoundFloat(Uint32 anAttrId, BoundType type,
- const float val) {
- float value = (float)val;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-
- voidint setBoundDecimal(const char* anAttrName, BoundType type,
- decimal_t * val) {
-
- int ret = -1;
- char * theValue = decimal2bytes(val);
- if (theValue != NULL) {
- ret = self->setBound(anAttrName, type, (void *) theValue);
- free(theValue);
- }
- return ret;
- };
- voidint setBoundDecimal(Uint32 anAttrId, BoundType type,
- decimal_t * val) {
-
- int ret = -1;
- char * theValue = decimal2bytes(val);
- if (theValue != NULL) {
- ret = self->setBound(anAttrId, type, (void *) theValue);
- free(theValue);
- }
- return ret;
- };
-
- voidint setBoundTimestamp(const char* anAttrName, BoundType type,
- NdbTimestamp anInputTimestamp) {
- Uint32 value = (Uint32)anInputTimestamp;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- voidint setBoundTimestamp(Uint32 anAttrId, BoundType type,
- NdbTimestamp anInputTimestamp) {
- Uint32 value = (Uint32)anInputTimestamp;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-
- voidint setBoundDatetime(const char* anAttrName, BoundType type,
- NdbDateTime * anInputDateTime) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
-
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1){
- return -1;
- }
- return self->setBound(anAttrName,type,(void *) &dtval);
- };
- voidint setBoundDatetime(Uint32 anAttrId, BoundType type,
- NdbDateTime * anInputDateTime) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1){
- return -1;
- }
- return self->setBound(anAttrId,type,(void *) &dtval);
- };
-
- voidint setBoundBytes(const char* anAttrName, BoundType type,
- const char * BYTE, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrName,type,(void *)stringVal);
- free(stringVal);
- return retval;
- };
- voidint setBoundBytes(Uint32 anAttrId, BoundType type,
- const char * BYTE, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrId,type,(void *)stringVal);
- free(stringVal);
- return retval;
- };
-
- voidint setBoundString(const char* anAttrName, BoundType type,
- const char * anInputString, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrName,type,(void *)stringVal);
- free(stringVal);
- return retval;
- };
- voidint setBoundString(Uint32 anAttrId, BoundType type,
- const char * anInputString, size_t len ) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrId,type,(void *)stringVal);
- free(stringVal);
- return retval;
- };
-
- voidint whereGreaterThan(const char * columnName, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(Uint32 columnId, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(const char * columnName, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(Uint32 columnId, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(const char * columnName, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(Uint32 columnId, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(const char * columnName, double val) {
- double value = (double)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(Uint32 columnId, double val) {
- double value = (double)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(const char * columnName, float val) {
- float value = (float)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(Uint32 columnId, float val) {
- float value = (float)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLT,
- (void *) &value);
- }
- voidint whereGreaterThan(const char * columnName, decimal_t * anInputValue) {
-
- int ret = -1;
- char * theValue = decimal2bytes(anInputValue);
- if (theValue != NULL) {
- ret = self->setBound(columnName, NdbIndexScanOperation::BoundLT,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
- voidint whereGreaterThan(Uint32 columnId, decimal_t * anInputValue) {
-
- int ret = -1;
- char * theValue = decimal2bytes(anInputValue);
- if (theValue != NULL) {
- ret = self->setBound(columnId, NdbIndexScanOperation::BoundLT,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
-
- voidint whereGreaterThan(const char* anAttrName,
- const char * anInputString, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundLT,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
- voidint whereGreaterThan(Uint32 anAttrId,
- const char * anInputString, size_t len ) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundLT,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
-
-
- voidint whereGreaterThanEqualTo(const char * columnName, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
- voidint whereGreaterThanEqualTo(Uint32 columnId, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
-
- voidint whereGreaterThanEqualTo(const char * columnName, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
- voidint whereGreaterThanEqualTo(Uint32 columnId, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
-
- voidint whereGreaterThanEqualTo(const char * columnName, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
- voidint whereGreaterThanEqualTo(Uint32 columnId, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
-
- voidint whereGreaterThanEqualTo(const char * columnName, double val) {
- double value = (double)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
- voidint whereGreaterThanEqualTo(Uint32 columnId, double val) {
- double value = (double)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
-
- voidint whereGreaterThanEqualTo(const char * columnName, float val) {
- float value = (float)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
- voidint whereGreaterThanEqualTo(Uint32 columnId, float val) {
- float value = (float)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundLE,
- (void *) &value);
- }
-
- voidint whereGreaterThanEqualTo(const char * columnName,
- decimal_t * anInputDecimal) {
- int ret = -1;
- char * theValue = decimal2bytes(anInputDecimal);
- if (theValue != NULL) {
- ret = self->setBound(columnName, NdbIndexScanOperation::BoundLE,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
- voidint whereGreaterThanEqualTo(Uint32 columnId, Int64 anInputDecimal) {
- int ret = -1;
- char * theValue = decimal2bytes(val);
- if (theValue != NULL) {
- ret = self->setBound(columnId, NdbIndexScanOperation::BoundLE,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- Int64 value = (Int64)val;
- }
-
- voidint whereGreaterThanEqualTo(const char* anAttrName,
- const char * anInputString, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundLE,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
- voidint whereGreaterThanEqualTo(Uint32 anAttrId,
- const char * anInputString, size_t len ) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundLE,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
-
- voidint whereLessThan(const char * columnName, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
- voidint whereLessThan(Uint32 columnId, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
-
- voidint whereLessThan(const char * columnName,
- Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
- voidint whereLessThan(Uint32 columnId, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
-
- voidint whereLessThan(const char * columnName, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
- voidint whereLessThan(Uint32 columnId, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
-
- voidint whereLessThan(const char * columnName, double val) {
- double value = (double)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
- voidint whereLessThan(Uint32 columnId, double val) {
- double value = (double)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *) &value);
- }
-
- voidint whereLessThan(const char * columnName, float val) {
- float value = (float)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
- voidint whereLessThan(Uint32 columnId, float val) {
- float value = (float)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGT,
- (void *) &value);
- }
-
- voidint whereLessThan(const char * columnName, Int64 anInputDecimal) {
- int ret = -1;
- char * theValue = decimal2bytes(anInputDecimal);
- if (theValue != NULL) {
- ret = self->setBound(columnName, NdbIndexScanOperation::BoundGT,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
- voidint whereLessThan(Uint32 columnId, Int64 anInputDecimal) {
- int ret = -1;
- char * theValue = decimal2bytes(anInputDecimal);
- if (theValue != NULL) {
- ret = self->setBound(columnId, NdbIndexScanOperation::BoundGT,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
-
- voidint whereLessThan(const char* anAttrName,
- const char * anInputString, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundGT,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
- voidint whereLessThan(Uint32 anAttrId,
- const char * anInputString, size_t len ) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundGT,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
-
- voidint whereLessThanEqualTo(const char * columnName, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
- voidint whereLessThanEqualTo(Uint32 columnId, Int32 val) {
- Int32 value = (Int32)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
-
- voidint whereLessThanEqualTo(const char * columnName, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
- voidint whereLessThanEqualTo(Uint32 columnId, Int64 val) {
- Int64 value = (Int64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
-
- voidint whereLessThanEqualTo(const char * columnName, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
- voidint whereLessThanEqualTo(Uint32 columnId, Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
-
- voidint whereLessThanEqualTo(const char * columnName, double val) {
- double value = (double)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
- voidint whereLessThanEqualTo(Uint32 columnId, double val) {
- double value = (double)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
-
- voidint whereLessThanEqualTo(const char * columnName, float val) {
- float value = (float)val;
- return self->setBound(columnName,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
- voidint whereLessThanEqualTo(Uint32 columnId, float val) {
- float value = (float)val;
- return self->setBound(columnId,NdbIndexScanOperation::BoundGE,
- (void *) &value);
- }
-
- voidint whereLessThanEqualTo(const char * columnName, Int64 anInputDecimal) {
- int ret = -1;
- char * theValue = decimal2bytes(anInputDecimal);
- if (theValue != NULL) {
- ret = self->setBound(columnName, NdbIndexScanOperation::BoundGE,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
- voidint whereLessThanEqualTo(Uint32 columnId, Int64 anInputDecimal) {
- int ret = -1;
- char * theValue = decimal2bytes(anInputDecimal);
- if (theValue != NULL) {
- ret = self->setBound(columnId, NdbIndexScanOperation::BoundGE,
- (void *) theValue);
- free(theValue);
- }
- return ret;
- }
-
- voidint whereLessThanEqualTo(const char* anAttrName,
- const char * anInputString, size_t len) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundGE,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
- voidint whereLessThanEqualTo(Uint32 anAttrId,
- const char * anInputString, size_t len ) {
- const NdbDictionary::Column * theColumn =
- self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL) {
- return -1;
- }
- int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundGE,
- (void *)stringVal);
- free(stringVal);
- return retval;
- };
-
-}
=== removed file 'storage/ndb/swig/ndbapi/NdbOperation.i'
--- a/storage/ndb/swig/ndbapi/NdbOperation.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbOperation.i 1970-01-01 00:00:00 +0000
@@ -1,616 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbOperation {
-
- NdbOperation(Ndb* aNdb, Type aType = PrimaryKeyAccess);
- virtual ~NdbOperation();
-
-public:
-
- enum Type {
- PrimaryKeyAccess = 0,
- UniqueIndexAccess = 1,
- TableScan = 2,
- OrderedIndexScan = 3,
- };
-
- enum LockMode {
- LM_Read = 0,
- LM_Exclusive = 1,
- LM_CommittedRead = 2,
- LM_Dirty = 2
- };
-
- %ndbnoexception;
-
- // These are not expected to fail
- const NdbError & getNdbError() const;
- int getNdbErrorLine();
- const char* getTableName() const;
-
- void setPartitionId(Uint32 id);
- Uint32 getPartitionId() const;
-
- const NdbDictTable * getTable() const;
-
- %ndbexception("NdbApiException") {
- $action
- if (result == NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception_err(NdbApiException,err.message,err);
- }
- }
-
- NdbTransaction* getNdbTransaction();
-
- virtual NdbBlob* getBlobHandle(const char* anAttrName);
- virtual NdbBlob* getBlobHandle(Uint32 anAttrId);
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception_err(NdbApiException,err.message,err);
- }
- }
-
-
- %rename(equalInt) equal(const char *, Int32);
- %rename(equalInt) equal(Uint32, Int32);
- voidint equal(const char* anAttrName, Int32 aValue);
- voidint equal(Uint32 anAttrId, Int32 aValue);
-
- %rename(equalUint) equal(const char *, Uint32);
- %rename(equalUint) equal(Uint32, Uint32);
- voidint equal(const char* anAttrName, Uint32 aValue);
- voidint equal(Uint32 anAttrId, Uint32 aValue);
-
- %rename(equalLong) equal(const char *, Int64);
- %rename(equalLong) equal(Uint32, Int64);
- voidint equal(const char* anAttrName, Int64 aValue);
- voidint equal(Uint32 anAttrId, Int64 aValue);
-
- %rename(equalUlong) equal(const char *, Uint64);
- %rename(equalUlong) equal(Uint32, Uint64);
-
- voidint equal(const char* anAttrName, Uint64 aValue);
- voidint equal(Uint32 anAttrId, Uint64 aValue);
-
-
- virtual voidint readTuple(LockMode);
- virtual voidint insertTuple();
- virtual voidint writeTuple();
- virtual voidint updateTuple();
- virtual voidint deleteTuple();
-
-
-/* Interpreted Program Support */
-
-#if !defined(SWIG_RUBY_AUTORENAME)
- %rename(incValueLong) incValue(const char*, Uint32);
- %rename(incValueLong) incValue(Uint32, Uint32);
- %rename(incValueUlong) incValue(const char*, Uint64);
- %rename(incValueUlong) incValue(Uint32, Uint64);
-
- %rename(subValueLong) subValue(const char*, Uint32);
- %rename(subValueLong) subValue(Uint32, Uint32);
- %rename(subValueUlong) subValue(const char*, Uint64);
- %rename(subValueUlong) subValue(Uint32, Uint64);
-#endif
-
- %contract incValue(const char* anAttrName, Uint32 aValue) {
-require:
- aValue > 0;
- }
- voidint incValue(const char* anAttrName, Uint32 aValue);
-
- %contract incValue(Uint32 anAttrId, Uint32 aValue) {
-require:
- aValue > 0;
- }
- voidint incValue(Uint32 anAttrId, Uint32 aValue);
-
- %contract incValue(const char* anAttrName, Uint64 aValue) {
-require:
- aValue > 0;
- }
- voidint incValue(const char* anAttrName, Uint64 aValue);
-
- %contract incValue(Uint32 anAttrId, Uint64 aValue ) {
-require:
- aValue > 0;
- }
- voidint incValue(Uint32 anAttrId, Uint64 aValue);
-
- voidint subValue(const char* anAttrName, Uint32 aValue);
- voidint subValue(const char* anAttrName, Uint64 aValue);
- voidint subValue(Uint32 anAttrId, Uint32 aValue);
- voidint subValue(Uint32 anAttrId, Uint64 aValue);
-
-#if !defined(SWIG_RUBY_AUTORENAME)
- %rename(defLabel) def_label(int labelNumber);
- %rename(addReg) add_reg(Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest);
- %rename(subReg) sub_reg(Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest);
- %rename(loadConstU32) load_const_u32(Uint32 RegDest, Uint32 Constant);
- %rename(loadConstU64) load_const_u64(Uint32 RegDest, Uint64 Constant);
- %rename(loadConstNull) load_const_null(Uint32 RegDest);
- %rename(readAttr) read_attr(const char* anAttrName, Uint32 RegDest);
- %rename(writeAttr) write_attr(const char* anAttrName, Uint32 RegSource);
- %rename(readAttr) read_attr(Uint32 anAttrId, Uint32 RegDest);
- %rename(writeAttr) write_attr(Uint32 anAttrId, Uint32 RegSource);
- %rename(branchGe) branch_ge(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- %rename(branchGt) branch_gt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- %rename(branchLe) branch_le(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- %rename(branchLt) branch_lt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- %rename(branchEq) branch_eq(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- %rename(branchNe) branch_ne(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- %rename(branchNeNull) branch_ne_null(Uint32 RegLvalue, Uint32 Label);
- %rename(branchEqNull) branch_eq_null(Uint32 RegLvalue, Uint32 Label);
- %rename(branchLabel) branch_label(Uint32 Label);
- %rename(branchColEqNull) branch_col_eq_null(Uint32 ColId, Uint32 Label);
- %rename(branchColNeNull) branch_col_ne_null(Uint32 ColId, Uint32 Label);
-#endif
-
- voidint def_label(int labelNumber);
- voidint add_reg(Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest);
- voidint sub_reg(Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest);
- voidint load_const_u32(Uint32 RegDest, Uint32 Constant);
- voidint load_const_u64(Uint32 RegDest, Uint64 Constant);
- voidint load_const_null(Uint32 RegDest);
- voidint read_attr(const char* anAttrName, Uint32 RegDest);
- voidint write_attr(const char* anAttrName, Uint32 RegSource);
- voidint read_attr(Uint32 anAttrId, Uint32 RegDest);
- voidint write_attr(Uint32 anAttrId, Uint32 RegSource);
- voidint branch_ge(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- voidint branch_gt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- voidint branch_le(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- voidint branch_lt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- voidint branch_eq(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- voidint branch_ne(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label);
- voidint branch_ne_null(Uint32 RegLvalue, Uint32 Label);
- voidint branch_eq_null(Uint32 RegLvalue, Uint32 Label);
- voidint branch_label(Uint32 Label);
- voidint branch_col_eq_null(Uint32 ColId, Uint32 Label);
- voidint branch_col_ne_null(Uint32 ColId, Uint32 Label);
-
-#if !defined(SWIG_RUBY_AUTORENAME)
- %rename(interpretExitOk) interpret_exit_ok();
- %rename(interpretExitNok) interpret_exit_nok(Uint32);
- %rename(interpretExitNok) interpret_exit_nok();
- %rename(interpretExitLastRow) interpret_exit_last_row();
- %rename(defSubroutine) def_subroutine(int);
- %rename(callSub) call_sub(Uint32);
- %rename(retSub) ret_sub();
-#endif
-
- voidint interpret_exit_ok();
- voidint interpret_exit_nok(Uint32 ErrorCode);
- voidint interpret_exit_nok();
- voidint interpret_exit_last_row();
- voidint def_subroutine(int SubroutineNumber);
- voidint call_sub(Uint32 Subroutine);
- voidint ret_sub();
-
- virtual voidint interpretedUpdateTuple();
- virtual voidint interpretedDeleteTuple();
-
-
- %ndbnoexception;
-
-};
-
-
-%extend NdbOperation {
-
-
-public:
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception_err(NdbApiException,err.message,err);
- }
- }
-
- NdbRecAttr* getValue(const char* anAttrName) {
- return self->getValue(anAttrName,NULL);
- }
- NdbRecAttr* getValue(Uint32 anAttrId) {
- return self->getValue(anAttrId,NULL);
- }
- NdbRecAttr* getValue(const NdbDictColumn* col) {
- return self->getValue(col,NULL);
- }
-
-
- const char * getColumnCharsetName(const char* columnName) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(columnName);
- const CHARSET_INFO * csinfo = theColumn->getCharset();
- if (csinfo == NULL) {
- return "latin1";
- }
- return csinfo->csname;
- }
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception_err(NdbApiException,err.message,err);
- }
- }
-
- voidint equalNull(const NdbDictColumn * theColumn) {
- return self->equal(theColumn->getName(), (char*)0);
- }
- voidint equalNull(const char* anAttrName) {
- return self->equal(anAttrName, (char*)0);
- }
- voidint equalNull(Uint32 anAttrId) {
- return self->equal(anAttrId, (char*)0);
- }
-
- voidint equalInt(const NdbDictColumn * theColumn, Int32 theValue) {
- return self->equal(theColumn->getName(), theValue);
- }
- voidint equalUint(const NdbDictColumn * theColumn, Uint32 theValue) {
- return self->equal(theColumn->getName(), theValue);
- }
- voidint equalLong(const NdbDictColumn * theColumn, Int64 theValue) {
- return self->equal(theColumn->getName(), theValue);
- }
- voidint equalUlong(const NdbDictColumn * theColumn, Uint64 theValue) {
- return self->equal(theColumn->getName(), theValue);
- }
- voidint equalShort(const NdbDictColumn * theColumn, short theValue) {
- return self->equal(theColumn->getName(), theValue);
- }
- voidint equalShort(const char* anAttrName, short theValue) {
- return self->equal(anAttrName, (Int32)theValue);
- }
- voidint equalShort(Uint32 anAttrId, short theValue) {
- return self->equal(anAttrId, (Int32)theValue);
- }
-
- voidint setBytes(const char* anAttrName, const char* BYTE, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->setValue(anAttrName,stringVal);
- free(stringVal);
- return retval;
- }
- voidint setBytes(Uint32 anAttrId, const char* BYTE, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->setValue(anAttrId,stringVal);
- free(stringVal);
- return retval;
- }
-
- voidint setString(const char* anAttrName,
- const char* anInputString, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->setValue(anAttrName,stringVal);
- free(stringVal);
- return retval;
- }
- voidint setString(Uint32 anAttrId,
- const char* anInputString, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->setValue(anAttrId,stringVal);
- free(stringVal);
- return retval;
- }
-
- voidint equalString(const char* anAttrName,
- const char* anInputString, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->equal(anAttrName,stringVal);
- free(stringVal);
- return retval;
- }
- voidint equalString(Uint32 anAttrId,
- const char* anInputString, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->equal(anAttrId,stringVal);
- free(stringVal);
- return retval;
- }
-
- voidint setShort(const char* anAttrName, short intVal) {
- return self->setValue(anAttrName,(Int32)intVal);
- }
- voidint setShort(Uint32 anAttrId, short intVal) {
- return self->setValue(anAttrId,(Int32)intVal);
- }
-
- voidint setInt(const char* anAttrName, Int32 intVal) {
- return self->setValue(anAttrName,intVal);
- }
- voidint setInt(Uint32 anAttrId, Int32 intVal) {
- return self->setValue(anAttrId,intVal);
- }
-
- voidint setLong(const char* anAttrName, Int64 intVal) {
- return self->setValue(anAttrName,intVal);
- }
- voidint setLong(Uint32 anAttrId, Int64 intVal) {
- return self->setValue(anAttrId,intVal);
- }
-
- voidint setDouble(const char* anAttrName, double intVal) {
- return self->setValue(anAttrName,intVal);
- }
- voidint setDouble(Uint32 anAttrId, double intVal) {
- return self->setValue(anAttrId,intVal);
- }
-
- voidint setFloat(const char* anAttrName, float intVal) {
- return self->setValue(anAttrName,intVal);
- }
- voidint setFloat(Uint32 anAttrId, float intVal) {
- return self->setValue(anAttrId,intVal);
- }
-
- voidint setDecimal(Uint32 anAttrId, decimal_t * dec) {
-
- int theScale = dec->frac;
- int thePrecision = (dec->intg)+theScale;
-
- char * theValue = (char *) malloc(decimal_bin_size(thePrecision,
- theScale));
- decimal2bin(dec, theValue, thePrecision, theScale);
- int ret = self->setValue(anAttrId,theValue);
- free(theValue);
- return ret;
- }
- voidint setDecimal(const char* anAttrName, decimal_t * dec) {
-
- int theScale = dec->frac;
- int thePrecision = (dec->intg)+theScale;
-
- char * theValue = (char *) malloc(decimal_bin_size(thePrecision,
- theScale));
- decimal2bin(dec, theValue, thePrecision, theScale);
- int ret = self->setValue(anAttrName,theValue);
- free(theValue);
- return ret;
- }
-
- voidint setDatetime(const char* anAttrName, NdbDateTime * anInputDateTime) {
-
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
-
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1) {
- return dtval;
- }
- return self->setValue(anAttrName,dtval);
-
- }
-
- voidint setDatetime(Uint32 anAttrId, NdbDateTime * anInputDateTime) {
-
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
-
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1) {
- return dtval;
- }
- return self->setValue(anAttrId,dtval);
- }
-
- voidint setTimestamp(const char* anAttrName, NdbTimestamp anInputTimestamp) {
- return self->setValue(anAttrName,anInputTimestamp);
- }
- voidint setTimestamp(Uint32 anAttrId, NdbTimestamp anInputTimestamp) {
- return self->setValue(anAttrId,anInputTimestamp);
- }
-
-
- voidint setNull(const char * anAttrName) {
- return self->setValue(anAttrName,(char *)0);
- }
- voidint setNull(Uint32 anAttrId) {
- return self->setValue(anAttrId,(char *)0);
- }
-
-
- voidint equalBytes(const NdbDictColumn * theColumn,
- const char* BYTE, size_t len) {
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->equal(theColumn->getName(),stringVal);
- free(stringVal);
- return retval;
- }
- voidint equalBytes(const char* anAttrName,
- const char* BYTE, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->equal(anAttrName,stringVal);
- free(stringVal);
- return retval;
- }
- voidint equalBytes(Uint32 anAttrId,
- const char* BYTE, size_t len) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
- int retval = self->equal(anAttrId,stringVal);
- free(stringVal);
- return retval;
- }
-
- voidint equalDatetime(const NdbDictColumn * theColumn,
- NdbDateTime * anInputDateTime) {
-
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1)
- return dtval;
- return self->equal(theColumn->getName(),dtval);
- }
- voidint equalDatetime(const char* anAttrName,
- NdbDateTime * anInputDateTime) {
-
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
-
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1)
- return dtval;
- return self->equal(anAttrName,dtval);
- }
- voidint equalDatetime(Uint32 anAttrId, NdbDateTime * anInputDateTime) {
-
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
-
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1)
- return dtval;
- return self->equal(anAttrId,dtval);
- }
-
- voidint equalTimestamp(const NdbDictColumn * theColumn,
- NdbTimestamp anInputTimestamp) {
- return self->equal(theColumn->getName(),anInputTimestamp);
- }
- voidint equalTimestamp(const char* anAttrName,
- NdbTimestamp anInputTimestamp) {
- return self->equal(anAttrName,anInputTimestamp);
- }
- voidint equalTimestamp(Uint32 anAttrId,
- NdbTimestamp anInputTimestamp) {
- return self->equal(anAttrId,anInputTimestamp);
- }
-
- voidint equalDecimal(const NdbDictColumn * theColumn, decimal_t * decVal) {
-
- const int prec = theColumn->getPrecision();
- const int scale = theColumn->getScale();
-
- char * theValue = (char *) malloc(decimal_bin_size(prec, scale));
- decimal2bin(decVal, theValue, prec, scale);
- int ret = self->equal(theColumn->getName(),theValue);
- free(theValue);
- return ret;
- }
- voidint equalDecimal(Uint32 anAttrId, decimal_t * decVal) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
-
- const int prec = theColumn->getPrecision();
- const int scale = theColumn->getScale();
-
- char * theValue = (char *) malloc(decimal_bin_size(prec, scale));
- decimal2bin(decVal, theValue, prec, scale);
- int ret = self->equal(anAttrId,theValue);
- free(theValue);
- return ret;
- }
- voidint equalDecimal(const char * anAttrName, decimal_t * decVal) {
- const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
-
- const int prec = theColumn->getPrecision();
- const int scale = theColumn->getScale();
-
- char * theValue = (char *) malloc(decimal_bin_size(prec, scale));
- decimal2bin(decVal, theValue, prec, scale);
- int ret = self->equal(anAttrName,theValue);
- free(theValue);
- return ret;
- }
-
- voidint getColumnId(const char* columnName) {
- return getColumnId(self,columnName);
- }
-
-
- voidint branchColEq(Uint32 ColId, Int64 val, Uint32 len,
- bool nopad, Uint32 Label) {
- return self->branch_col_eq(ColId, (void *) &val, len, nopad, Label);
- }
- voidint branchColNe(Uint32 ColId, Int64 val, Uint32 len,
- bool nopad, Uint32 Label) {
- return self->branch_col_ne(ColId, (void *) &val, len, nopad, Label);
- }
- voidint branchColLt(Uint32 ColId, Int64 val, Uint32 len,
- bool nopad, Uint32 Label) {
- return self->branch_col_lt(ColId, (void *) &val, len, nopad, Label);
- }
- voidint branchColLe(Uint32 ColId, Int64 val, Uint32 len,
- bool nopad, Uint32 Label) {
- return self->branch_col_le(ColId, (void *) &val, len, nopad, Label);
- }
- voidint branchColGt(Uint32 ColId, Int64 val, Uint32 len,
- bool nopad, Uint32 Label) {
- return self->branch_col_gt(ColId, (void *) &val, len, nopad, Label);
- }
- voidint branchColGe(Uint32 ColId, Int64 val, Uint32 len,
- bool nopad, Uint32 Label) {
- return self->branch_col_ge(ColId, (void *) &val, len, nopad, Label);
- }
- voidint branchColLikeString(Uint32 ColId,
- const char* anInputString, size_t len,
- bool nopad, Uint32 Label) {
- return self->branch_col_like(ColId, (void *)anInputString, (Uint32)len,
- nopad, Label);
- };
- voidint branchColNotLikeString(Uint32 ColId,
- const char* anInputString, size_t len,
- bool nopad, Uint32 Label) {
- return self->branch_col_notlike(ColId, (void *)anInputString, (Uint32)len,
- nopad, Label);
- };
- voidint branchColLikeBytes(Uint32 ColId, const char* BYTE, size_t len,
- bool nopad, Uint32 Label) {
- return self->branch_col_like(ColId, (void *)BYTE, (Uint32)len,
- nopad, Label);
- };
- voidint branchColNotLikeBytes(Uint32 ColId, const char* BYTE, size_t len,
- bool nopad, Uint32 Label) {
- return self->branch_col_notlike(ColId, (void *)BYTE, (Uint32)len,
- nopad, Label);
- };
- %ndbnoexception;
-
-
-};
-
=== removed file 'storage/ndb/swig/ndbapi/NdbRecAttr.i'
--- a/storage/ndb/swig/ndbapi/NdbRecAttr.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbRecAttr.i 1970-01-01 00:00:00 +0000
@@ -1,222 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%newobject NdbRecAttr::getString();
-
-
-class NdbRecAttr {
- NdbRecAttr(Ndb*);
-
-public:
- ~NdbRecAttr();
-
- int isNULL();
-
-#if !defined(SWIG_RUBY_AUTORENAME)
- %rename(getInt64) int64_value();
- %rename(getInt32) int32_value();
- %rename(getShort) short_value();
- %rename(getChar) char_value();
- %rename(getUint64) u_64_value() const;
- %rename(getUint32) u_32_value();
- %rename(getUshort) u_short_value() const;
- %rename(getUchar) u_char_value() const;
- %rename(getFloat) float_value() const;
- %rename(getDouble) double_value() const;
-#else
- %rename(get_int64) int64_value();
- %rename(get_int32) int32_value();
- %rename(get_short) short_value();
- %rename(get_char) char_value();
- %rename(get_uint64) u_64_value() const;
- %rename(get_uint32) u_32_value();
- %rename(get_ushort) u_short_value() const;
- %rename(get_uchar) u_char_value() const;
- %rename(get_float) float_value() const;
- %rename(get_double) double_value() const;
- %rename(getSizeInBytes) get_size_in_bytes() const;
-#endif
-
- %ndbexception("NdbApiException") {
- $action
- }
-
- Int64 int64_value();
- Int32 int32_value();
- short short_value();
- char char_value();
- const unsigned long long u_64_value() const;
- const unsigned long u_32_value();
- const unsigned short u_short_value() const;
- const unsigned char u_char_value() const;
- float float_value() const;
- double double_value() const;
-
- char* aRef() const;
-
- %ndbnoexception;
-
- const NdbDictColumn * getColumn() const;
- NdbDictColumn::Type getType() const;
-
- Uint32 get_size_in_bytes() const;
-};
-
-%extend NdbRecAttr {
-
-#define uint2korr(A)(short) (((short) ((unsigned char) (A)[0])) + \
- ((short) ((unsigned char) (A)[1]) << 8))
-
- int getColType() const {
- NdbDictionary::Column::Type x = self->getType();
- int y = (int)x;
- return y;
- }
-
- %ndbexception("NdbApiException") {
- $action
- if (result->buf == NULL) {
- NDB_exception(NdbApiException,"Error fetching data");
- }
- }
-
- decimal_t * getDecimal() {
- NdbDictionary::Column::Type colType = self->getType();
-
- // (an array of ints, not base-10 digits)
- decimal_digit_t digits[DECIMAL_BUFF];
- decimal_t * dec = (decimal_t *)malloc(sizeof(decimal_t));
- dec->intg = 0;
- dec->frac = 0;
- dec->len = DECIMAL_BUFF;
- dec->sign = 0;
- dec->buf = digits;
-
- if(colType == NdbDictionary::Column::Decimal) {
-
- int prec = self->getColumn()->getPrecision();
- int scale = self->getColumn()->getScale();
- bin2decimal(self->aRef(), dec, prec, scale);
- }
-
- return dec;
-
-
- }
-
- %ndbexception("NdbApiException") {
- $action
- if ( (result.theString == NULL) || (result.theLength == -1) ) {
- NDB_exception(NdbApiException,"Error fetching data");
- }
- }
- BYTES getBytes() {
- NdbDictionary::Column::Type colType = self->getType();
- BYTES output;
- output.theString=NULL;
- output.theLength=-1;
-
- char* rec = self->aRef();
-
- if(colType == NdbDictionary::Column::Longvarbinary)
- {
- output.theLength=(int)uint2korr(rec);
- output.theString = &rec[2];
- }
- else if(colType == NdbDictionary::Column::Varbinary)
- {
-
- output.theLength = (int) (rec[0]);
- output.theString = &rec[1];
- }
- else if( colType == NdbDictionary::Column::Binary)
- {
- output.theLength = strlen(rec)-1;
- output.theString = &rec[0];
- }
- return output;
- }
-
- %ndbexception("NdbApiException") {
- $action
- if (result == NULL) {
- NDB_exception(NdbApiException,"Error fetching data");
- }
- }
-
- const char* getString() {
- NdbDictionary::Column::Type colType = self->getType();
-
- char* ref = self->aRef();
-
- if(colType == NdbDictionary::Column::Longvarchar)
- {
- int len=(int)uint2korr(ref);
- char * buff = (char *)malloc(len+1);
- memset(buff,0,len+1);
- ref+=2;
- memcpy(buff,ref,len);
- buff[len+1]='\0';
- return buff;
- }
- else if(colType == NdbDictionary::Column::Varchar)
- {
- short len = (short) (unsigned char) (ref[0]);
- char * buff = (char *)malloc(len+1);
- memset(buff,0, len+1);
- memcpy(buff,++ref,len);
- buff[len+1]='\0';
- return buff;
- }
- else if(colType == NdbDictionary::Column::Char)
- {
- int len=strlen(ref);
- int i=len-1;
- /**
- * truncate spaces...
- */
- while(ref[i] == ' ')
- {
- i--;
- }
- i++; //length of string until space padding starts..
- char * buff = (char *)malloc(i+1); //+1 for null;
- memcpy(buff, ref, i);
- buff[i]='\0';
- return buff;
- }
- return NULL;
- }
-
- %ndbnoexception;
- NdbDateTime * getDatetime() {
- return new NdbDateTime();
- }
-
- %ndbexception("NdbApiException") {
- $action
- }
-
- NdbTimestamp getTimestamp() {
- return (NdbTimestamp)(self->u_32_value());
- }
-
- %ndbnoexception;
-};
=== removed file 'storage/ndb/swig/ndbapi/NdbScanFilter.i'
--- a/storage/ndb/swig/ndbapi/NdbScanFilter.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbScanFilter.i 1970-01-01 00:00:00 +0000
@@ -1,686 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%{
-
- Uint32 cmpGetColumnLength(const NdbDictionary::Column * theColumn) {
-
- Uint32 cmpLength = 0;
- switch(theColumn->getType()) {
- case NDB_TYPE_VARCHAR:
- case NDB_TYPE_VARBINARY:
- {
- cmpLength=theColumn->getLength()+1;
- break;
- }
- case NDB_TYPE_LONGVARCHAR:
- case NDB_TYPE_LONGVARBINARY:
- {
- cmpLength=theColumn->getLength()+2;
- break;
- }
- case NDB_TYPE_CHAR:
- case NDB_TYPE_BINARY:
- {
- cmpLength=theColumn->getLength();
- break;
- }
- default:
- return 0;
- }
- return cmpLength;
- }
-
- %}
-
-class NdbScanFilter {
-
- class NdbScanFilterImpl & m_impl;
- NdbScanFilter& operator=(const NdbScanFilter&); ///< Defined not implemented
-public:
-
- NdbScanFilter(class NdbOperation * op);
- ~NdbScanFilter();
-
- /**
- * Group operators
- */
- enum Group {
- AND = 1, ///< (x1 AND x2 AND x3)
- OR = 2, ///< (x1 OR x2 OR X3)
- NAND = 3, ///< NOT (x1 AND x2 AND x3)
- NOR = 4 ///< NOT (x1 OR x2 OR x3)
- };
-
- enum BinaryCondition
- {
- COND_LE = 0, ///< lower bound
- COND_LT = 1, ///< lower bound, strict
- COND_GE = 2, ///< upper bound
- COND_GT = 3, ///< upper bound, strict
- COND_EQ = 4, ///< equality
- COND_NE = 5, ///< not equal
- COND_LIKE = 6, ///< like
- COND_NOT_LIKE = 7 ///< not like
- };
-
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NDB_exception(NdbApiException,"ScanFilter error" );
- }
- }
- NdbOperation * getNdbOperation();
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NDB_exception(NdbApiException,"ScanFilter error" );
- }
- }
- /**
- * Begin of compound.
- * ®return 0 if successful, -1 otherwize
- */
- int begin(Group group = AND);
-
- /**
- * End of compound.
- * ®return 0 if successful, -1 otherwize
- */
- int end();
-
- /** @} *********************************************************************/
-#if defined(SWIG_RUBY_AUTORENAME)
- %rename("is_true?") istrue;
- %rename("is_false?") isfalse;
- %rename("is_null?") isnull;
- %rename("is_not_null?") isnotnull;
-#else
- %rename istrue isTrue;
- %rename isfalse isFalse;
- %rename isnull isNull;
- %rename isnotnull isNotNull;
-#endif
-
- /**
- * <i>Explanation missing</i>
- */
- int istrue();
-
- /**
- * <i>Explanation missing</i>
- */
- int isfalse();
-
- /**
- * Compare column <b>ColId</b> with <b>val</b>
- */
-// int cmp(BinaryCondition cond, int ColId, const void *val, Uint32 len = 0);
-
- /**
- * @name Integer Comparators
- * @{
- */
- /** Compare column value with integer for equal
- * ®return 0 if successful, -1 otherwize
- */
- int eq(int ColId, Uint32 value);
-
- /** Compare column value with integer for not equal.
- * ®return 0 if successful, -1 otherwize
- */
- int ne(int ColId, Uint32 value);
- /** Compare column value with integer for less than.
- * ®return 0 if successful, -1 otherwize
- */
- int lt(int ColId, Uint32 value);
- /** Compare column value with integer for less than or equal.
- * ®return 0 if successful, -1 otherwize
- */
- int le(int ColId, Uint32 value);
- /** Compare column value with integer for greater than.
- * ®return 0 if successful, -1 otherwize
- */
- int gt(int ColId, Uint32 value);
- /** Compare column value with integer for greater than or equal.
- * ®return 0 if successful, -1 otherwize
- */
- int ge(int ColId, Uint32 value);
-
- /** Compare column value with integer for equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int eq(int ColId, Uint64 value);
- /** Compare column value with integer for not equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int ne(int ColId, Uint64 value);
- /** Compare column value with integer for less than. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int lt(int ColId, Uint64 value);
- /** Compare column value with integer for less than or equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int le(int ColId, Uint64 value);
- /** Compare column value with integer for greater than. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int gt(int ColId, Uint64 value);
- /** Compare column value with integer for greater than or equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int ge(int ColId, Uint64 value);
- /** @} *********************************************************************/
-
- /** Check if column value is NULL */
- int isnull(int ColId);
- /** Check if column value is non-NULL */
- int isnotnull(int ColId);
-
- %ndbnoexception
-};
-
-%extend NdbScanFilter {
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NDB_exception(NdbApiException,"ScanFilter error" );
- }
- }
-
-
- int cmp(BinaryCondition cond, int ColId) {
- return self->cmp(cond,ColId,(void *)0);
- };
- int cmp(BinaryCondition cond, int ColId, const Int32 val) {
- Int32 value = (Int32)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, int ColId, const Int64 val) {
- Int64 value = (Int64)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, int ColId, const Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, int ColId, const double val) {
- double value = (double)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, int ColId, const float val) {
- float value = (float)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmpTimestamp(BinaryCondition cond, int ColId,
- NdbTimestamp anInputTimestamp) {
- Uint32 value = (Uint32)anInputTimestamp;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, int ColId, NdbDateTime *anInputDateTime) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1)
- return -1;
- return self->cmp(cond,ColId,(void *) &dtval);
- };
-
- int cmp(BinaryCondition cond, int ColId, const char * BYTE, size_t len) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
-
- Uint32 cmpLength = 0;
- if (cond == NdbScanFilter::COND_EQ) {
- cmpLength = cmpGetColumnLength(theColumn);
- if (cmpLength == 0)
- return -1;
- } else if ((cond == NdbScanFilter::COND_LIKE)
- || (cond == NdbScanFilter::COND_NOT_LIKE)) {
- cmpLength = (Uint32)len;
- }
-
- int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
- free(stringVal);
- return retval;
- };
- int cmpString(BinaryCondition cond, int ColId,
- const char * anInputString, size_t len ) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
-
- Uint32 cmpLength = 0;
- if (cond == NdbScanFilter::COND_EQ) {
- cmpLength = cmpGetColumnLength(theColumn);
- if (cmpLength == 0)
- return -1;
- } else if ((cond == NdbScanFilter::COND_LIKE)
- || (cond == NdbScanFilter::COND_NOT_LIKE)) {
- cmpLength = (Uint32)len;
- }
-
- int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
- free(stringVal);
- return retval;
- };
-
-
-
- int cmp(BinaryCondition cond, const char * ColName) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->cmp(cond,ColId,(void *)0);
- };
- int cmp(BinaryCondition cond, const char * ColName, const Int32 val) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- Int32 value = (Int32)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, const char * ColName, const Int64 val) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- Int64 value = (Int64)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, const char * ColName, const Uint64 val) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- Uint64 value = (Uint64)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, const char * ColName, const double val) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- double value = (double)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, const char * ColName, const float val) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- float value = (float)val;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmpTimestamp(BinaryCondition cond, const char * ColName,
- NdbTimestamp anInputTimestamp) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- Uint32 value = (Uint32)anInputTimestamp;
- return self->cmp(cond,ColId,(void *) &value);
- };
- int cmp(BinaryCondition cond, const char * ColName,
- NdbDateTime *anInputDateTime) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- Uint64 dtval = ndbFormatDateTime(theColumn,anInputDateTime);
- if (dtval == 1)
- return -1;
- return self->cmp(cond,ColId,(void *) &dtval);
- };
-
- int cmp(BinaryCondition cond, const char * ColName,
- const char * BYTE, size_t len) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- char * stringVal = ndbFormatString(theColumn,BYTE,len);
- if (stringVal == NULL)
- return -1;
-
- Uint32 cmpLength = 0;
- if (cond == NdbScanFilter::COND_EQ) {
- cmpLength = cmpGetColumnLength(theColumn);
- if (cmpLength == 0)
- return -1;
- } else if ((cond == NdbScanFilter::COND_LIKE)
- || (cond == NdbScanFilter::COND_NOT_LIKE)) {
- cmpLength = (Uint32)len;
- }
-
- int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
- free(stringVal);
- return retval;
- };
- int cmpString(BinaryCondition cond, const char * ColName,
- const char * anInputString, size_t len ) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- Uint32 cmpLength = 0;
- if (cond == NdbScanFilter::COND_EQ) {
- cmpLength = cmpGetColumnLength(theColumn);
- if (cmpLength == 0)
- return -1;
- } else if ((cond == NdbScanFilter::COND_LIKE) || (cond == NdbScanFilter::COND_NOT_LIKE)) {
- cmpLength = (Uint32)len;
- }
- int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
- free(stringVal);
- return retval;
- };
-
- /** Compare column value with integer for equal
- * ®return 0 if successful, -1 otherwize
- */
- int eq(const char * ColName, Uint32 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->eq(ColId,value);
- }
-
- /** Compare column value with integer for not equal.
- * ®return 0 if successful, -1 otherwize
- */
- int ne(const char * ColName, Uint32 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->ne(ColId,value);
- }
-
- /** Compare column value with integer for less than.
- * ®return 0 if successful, -1 otherwize
- */
- int lt(const char * ColName, Uint32 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->lt(ColId,value);
- }
-
- /** Compare column value with integer for less than or equal.
- * ®return 0 if successful, -1 otherwize
- */
- int le(const char * ColName, Uint32 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->le(ColId,value);
- }
-
- /** Compare column value with integer for greater than.
- * ®return 0 if successful, -1 otherwize
- */
- int gt(const char * ColName, Uint32 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->gt(ColId,value);
- }
-
- /** Compare column value with integer for greater than or equal.
- * ®return 0 if successful, -1 otherwize
- */
- int ge(const char * ColName, Uint32 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->ge(ColId,value);
- }
-
-
- /** Compare column value with integer for equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int eq(const char * ColName, Uint64 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->eq(ColId,value);
- }
- int eq(const char * ColName, const char * anInputString, size_t len ) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
-
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- Uint32 cmpLength = cmpGetColumnLength(theColumn);
- if (cmpLength == 0)
- return -1;
- int retval = self->cmp(NdbScanFilter::COND_EQ,ColId,
- (void *)stringVal,cmpLength);
- free(stringVal);
- return retval;
- };
-
- int eq(int ColId, const char * anInputString, size_t len ) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
-
- const NdbDictionary::Column * theColumn = op->getTable()->getColumn(ColId);
- char * stringVal = ndbFormatString(theColumn,anInputString,len);
- if (stringVal == NULL)
- return -1;
- Uint32 cmpLength = cmpGetColumnLength(theColumn);
- if (cmpLength == 0)
- return -1;
- int retval = self->cmp(NdbScanFilter::COND_EQ,ColId,
- (void *)stringVal,cmpLength);
- free(stringVal);
- return retval;
- };
-
- /** Compare column value with integer for not equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int ne(const char * ColName, Uint64 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->ne(ColId,value);
- }
-
- /** Compare column value with integer for less than. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int lt(const char * ColName, Uint64 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->lt(ColId,value);
- }
-
- /** Compare column value with integer for less than or equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int le(const char * ColName, Uint64 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->le(ColId,value);
- }
-
- /** Compare column value with integer for greater than. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int gt(const char * ColName, Uint64 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->gt(ColId,value);
- }
-
- /** Compare column value with integer for greater than or equal. 64-bit.
- * ®return 0 if successful, -1 otherwize
- */
- int ge(const char * ColName, Uint64 value) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->ge(ColId,value);
- }
-
- /** Check if column value is NULL */
- int isNull(const char * ColName) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->isnull(ColId);
- }
-
- /** Check if column value is non-NULL */
- int isNotNull(const char * ColName) {
- NdbOperation * op = self->getNdbOperation();
- if (op == NULL)
- return -1;
- int ColId = getColumnId(op,ColName);
- if (ColId == -1) {
- return ColId;
- }
- return self->isnotnull(ColId);
- }
-
-
-
-
- %ndbnoexception
-
- }
=== removed file 'storage/ndb/swig/ndbapi/NdbScanOperation.i'
--- a/storage/ndb/swig/ndbapi/NdbScanOperation.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbScanOperation.i 1970-01-01 00:00:00 +0000
@@ -1,100 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-class NdbScanOperation : public NdbOperation {
-
-protected:
- NdbScanOperation(Ndb* aNdb,
- NdbOperation::Type aType = NdbOperation::TableScan);
- virtual ~NdbScanOperation();
-
-public:
-
- enum ScanFlag {
- SF_TupScan = (1 << 16), // scan TUP order
- SF_DiskScan = (2 << 16), // scan in DISK order
- SF_OrderBy = (1 << 24), // index scan in order
- SF_Descending = (2 << 24), // index scan in descending order
- SF_ReadRangeNo = (4 << 24), // enable @ref get_range_no
- SF_MultiRange = (8 << 24), // scan is part of multi-range scan
- SF_KeyInfo = 1 // request KeyInfo to be sent back
- };
-
- %ndbexception("NdbApiException") {
- $action
- if (result==-1) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- virtual voidint readTuples(LockMode lock_mode=LM_Read, Uint32 scan_flags=0,
- Uint32 parallel=0, Uint32 batch=0);
-
- inline voidint readTuples(int parallell){
- return readTuples(LM_Read, 0, parallell);
- }
-
- inline voidint readTuplesExclusive(int parallell = 0){
- return readTuples(LM_Exclusive, 0, parallell);
- }
-
- int nextResult(bool fetchAllowed = true, bool forceSend = false);
- voidint deleteCurrentTuple();
- voidint deleteCurrentTuple(NdbTransaction* takeOverTransaction);
- voidint restart(bool forceSend = false);
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- NdbBlob* getBlobHandle(const char* anAttrName);
- NdbBlob* getBlobHandle(Uint32 anAttrId);
- NdbOperation* lockCurrentTuple();
- NdbOperation* lockCurrentTuple(NdbTransaction* lockTrans);
- NdbOperation* updateCurrentTuple();
- NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans);
-
- %ndbnoexception;
-
- const NdbError & getNdbError() const;
-
- void close(bool forceSend = false, bool releaseOp = false);
-};
-
-%extend NdbScanOperation {
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- NdbScanFilter * getNdbScanFilter() {
- return new NdbScanFilter(self);
- }
- %ndbnoexception
- }
=== removed file 'storage/ndb/swig/ndbapi/NdbTransaction.i'
--- a/storage/ndb/swig/ndbapi/NdbTransaction.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/NdbTransaction.i 1970-01-01 00:00:00 +0000
@@ -1,257 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%delobject NdbTransaction::close;
-
-class NdbTransaction {
- ~NdbTransaction();
- NdbTransaction(Ndb* aNdb);
-
-public:
-
- const NdbError & getNdbError() const;
-
- %ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
- Ndb* getNdb();
-
- NdbOperation* getNdbOperation(const class NdbDictTable* aTable);
- NdbOperation* getNdbOperation(const char* aTableName);
-
- /* These first two are deprecated */
- NdbIndexScanOperation* getNdbIndexScanOperation(const char* anIndexName,
- const char* aTableName);
- NdbIndexScanOperation* getNdbIndexScanOperation(const NdbDictIndex *anIndex,
- const NdbDictTable *aTable);
- NdbIndexScanOperation* getNdbIndexScanOperation(const NdbDictIndex *anIndex);
-
- NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
- const char* aTableName);
- NdbIndexOperation* getNdbIndexOperation(const NdbDictIndex *anIndex,
- const NdbDictTable *aTable);
- NdbIndexOperation* getNdbIndexOperation(const NdbDictIndex *anIndex);
-
-
- NdbScanOperation* getNdbScanOperation(const class NdbDictTable* aTable);
- NdbScanOperation* getNdbScanOperation(const char* aTableName);
- NdbOperation* getNdbErrorOperation();
-
- %ndbnoexception;
-
- // TODO: Verify that this can't throw?
- const NdbOperation * getNextCompletedOperation(const NdbOperation * op)const;
-
-
- %ndbexception("NdbApiException,NdbApiTemporaryException,"
- "NdbApiPermanentException,"
- "InvalidSchemaObjectVersionException") {
- $action
- if (result < 0) {
- NdbError err = arg1->getNdbError();
- if (err.code == 241) { // Invalid Schema Version - see ndberror.c
- NDB_exception_err(InvalidSchemaObjectVersionException,
- err.message,err);
- } else {
- switch (err.status) {
- case NdbError::TemporaryError:
- NDB_exception_err(NdbApiTemporaryException,err.message,err);
- break;
- case NdbError::PermanentError:
- // TODO: We should probably at least handle all the various
- // error classifications. mmm, thats going to suck
- // and then we should figure out how to do that all over the place
- NDB_exception_err(NdbApiPermanentException,err.message,err);
- break;
- default:
- NDB_exception_err(NdbApiException,err.message,err);
- break;
- }
- }
- }
- }
- int execute(ExecType execType,
- AbortOption abortOption = AbortOnError,
- bool force = 0 );
- int restart(void);
- int getNdbErrorLine();
-
-
-
-};
-
-
-%extend NdbTransaction {
-public:
-
- %ndbnoexception;
-
- ~NdbTransaction() {
- if(self!=0)
- self->close();
- }
-
- void close() {
- if(self!=0)
- self->close();
- }
-
- bool isClosed() {
- return (self==0);
- }
-
- void executeAsynchPrepare(ExecType execType, asynch_callback_t * cb,
- AbortOption abortOption = AbortOnError) {
- cb->create_time=getMicroTime();
- self->executeAsynchPrepare(execType,theCallBack,(void *)cb, abortOption);
- }
-
- %ndbexception("NdbApiException,NdbApiTemporaryException,"
- "NdbApiPermanentException,") {
- $action
- if (result < 0) {
- NdbError err = arg1->getNdbError();
- switch (err.status) {
- case NdbError::TemporaryError:
- NDB_exception_err(NdbApiTemporaryException,err.message,err);
- break;
- case NdbError::PermanentError:
- NDB_exception_err(NdbApiPermanentException,err.message,err);
- break;
- default:
- NDB_exception_err(NdbApiException,err.message,err);
- break;
- }
- }
- }
-
- int executeNoCommit(AbortOption abortOption = AbortOnError) {
- return self->execute(NoCommit, abortOption,false);
- }
- int executeCommit(AbortOption abortOption = AbortOnError) {
- return self->execute(Commit, abortOption,false);
- }
- int executeRollback(AbortOption abortOption = AbortOnError) {
- return self->execute(Rollback, abortOption,false);
- }
- %ndbexception("NdbApiException") {
- $action
- if (result == NULL) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- %ndbexception("NdbApiException") {
- $action
- // This should get set before we ever get called.
- static bool selectCountError;
- if ( selectCountError ) {
- NdbError err = arg1->getNdbError();
- NDB_exception(NdbApiException,err.message);
- }
- }
-
- Uint64 selectCount(const char * tbl) {
-
- /**
- * This code is taken from the ndb_select_count.cpp utility program,
- * distributed with mysql-src.
- */
- Uint64 OUTPUT = 0;
- static bool selectCountError=false;
- int MAX_RETRIES=3;
- int retryAttempt=0;
- bool finished=false;
-
- NdbScanOperation *pOp = self->getNdbScanOperation(tbl);
- if (!pOp) {
- selectCountError=true;
- return OUTPUT;
- }
-
- // we retry the transaction up to MAX_RETRIES if we have a temporary error
- while ((retryAttempt < MAX_RETRIES) && !(finished)) {
-
- if( pOp->readTuples(NdbScanOperation::LM_Dirty) ) {
-
- finished=true;
- selectCountError = true; //NDBJ_ERR_SCAN_FAILED;
- }
-
- int check;
- check = pOp->interpret_exit_last_row();
-
- if( check == -1 ) {
-
- finished=true;
- selectCountError = true; //NDBJ_ERR_SCAN_FAILED;
-
- } else if (selectCountError == false) {
-
- Uint64 tmp;
- Uint32 row_size;
- pOp->getValue(NdbDictColumn::ROW_COUNT, (char*)&tmp);
- pOp->getValue(NdbDictColumn::ROW_SIZE, (char*)&row_size);
- check = self->execute(NdbTransaction::NoCommit);
- if( check != -1 ) {
- int eof;
- while((eof = pOp->nextResult(true)) == 0){
- OUTPUT += tmp;
- }
- if (eof == -1) {
- const NdbError err = self->getNdbError();
- // retry the transaction if we have a temporary error
- if (err.status == NdbError::TemporaryError){
- // usleep is Linux-specific. Its time unit is microseconds
- // sleep for 50 milliseconds
- usleep(50*1000);
- retryAttempt++;
- continue;
- }
- selectCountError = true; //NDBJ_SELECT_COUNT_ROW_COUNT_FAILED;
- finished=true;
- } else {
- selectCountError=false; //row_count;
- finished=true;
- }
- } else {
- selectCountError=true; //NDBJ_SELECT_COUNT_TRANS_EXEC_FAILED;
- finished=true;
- }
- }
- }
- if (finished==false) {
- selectCountError=true; //NDBJ_SELECT_COUNT_ROW_COUNT_FAILED;
- }
-
- // The return value 'ret' is the 'length' returned by select_count
- return OUTPUT;
-
- };
- %ndbnoexception;
-
-
-
-};
=== removed file 'storage/ndb/swig/ndbapi/ndbglobals.i'
--- a/storage/ndb/swig/ndbapi/ndbglobals.i 2008-03-11 15:27:35 +0000
+++ b/storage/ndb/swig/ndbapi/ndbglobals.i 1970-01-01 00:00:00 +0000
@@ -1,309 +0,0 @@
-/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Copyright (C) 2008 MySQL, Inc.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-%include "globals.i"
-%include "config.h"
-
-%{
-
-#include <my_global.h>
-#include <my_sys.h>
-
-#include <mysql.h>
-#include <NdbApi.hpp>
-
-/* These get included in mysql.h. Not sure they should... */
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef VERSION
-
-#include "config.h"
-
-
- long long getMicroTime()
- {
- struct timeval tTime;
- gettimeofday(&tTime, 0);
- long long microSeconds = (long long) tTime.tv_sec * 1000000 + tTime.tv_usec;
- return microSeconds;
- }
-
-
-/* voidint is a way to mark a method that returns int for SWIG
- to tell it we want the wrapped function to return void, but
- we don't want to discard the return value out of hand because
- we need it at the wrapping layer to find errors */
- typedef int voidint;
- typedef Uint32 NdbTimestamp;
-
-
- typedef struct st_byte {
- char * theString;
- int theLength;
- } BYTES;
-
-#ifdef _mysql_h
-#ifndef _decimal_h
-
-#define DECIMAL_BUFF 9
-
- typedef int32 decimal_digit_t;
-
- typedef struct st_decimal_t {
- int intg, frac, len;
- my_bool sign;
- decimal_digit_t *buf;
- } decimal_t;
-
-#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
-#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
- (dec)->frac + ((dec)->frac > 0) + 2)
- extern "C" {
- int decimal_size(int precision, int scale);
- int decimal_bin_size(int precision, int scale);
- int decimal2bin(decimal_t *from, char *to, int precision, int scale);
- int bin2decimal(char *from, decimal_t *to, int precision, int scale);
- int decimal2string(decimal_t *from, char *to, int *to_len,
- int fixed_precision, int fixed_decimals,
- char filler);
- int internal_str2dec(const char *from, decimal_t *to, char **end,
- my_bool fixed);
- }
-#endif
-#endif
-
- char * decimal2bytes(decimal_t * val) {
-
- int theScale = val->frac;
- int thePrecision = (val->intg)+theScale;
-
- char * theValue = (char *) malloc(decimal_bin_size(thePrecision,
- theScale));
- if (theValue == NULL) {
- return NULL;
- }
- decimal2bin(val, theValue, thePrecision, theScale);
- return theValue;
- }
-
- class NdbDateTime
- {
- public:
- unsigned int year, month, day, hour, minute, second;
- NdbDateTime();
- };
-
- NdbDateTime::NdbDateTime() {
- year=0;
- month=0;
- day=0;
- hour=0;
- minute=0;
- second=0;
- }
-
-/* We don't just typedef these right in the first place
- because there because that would mean NdbDictionary::Dictionary
- would get renamed to NdbDictionary at the C level, which
- wouldn't work out so well. */
-
- typedef NdbDictionary::Object NdbDictObject;
- typedef NdbDictionary::Table NdbDictTable;
- typedef NdbDictionary::Column NdbDictColumn;
- typedef NdbDictionary::Index NdbDictIndex;
- typedef NdbDictionary::Dictionary NdbDictDictionary;
- typedef NdbDictionary::Event NdbDictEvent;
-
-
- int getColumnId(NdbOperation * op, const char* columnName) {
- const NdbDictColumn * theColumn = op->getTable()->getColumn(columnName);
- return theColumn->getColumnNo();
- }
-
- char * ndbFormatString(const NdbDictColumn * theColumn,
- const char* aString, size_t len) {
-
- // This method should be safe and do all the error checking.
- // There should be other methods in case you want to bypass checks.
- if (aString==0) {
- return 0;
- }
- if ((!theColumn) || (len>65535)) {
- return NULL;
- }
-
- switch(theColumn->getType()) {
- case NDB_TYPE_VARCHAR:
- case NDB_TYPE_VARBINARY:
- // printf("it's a varchar\n");
- if (len>255) {
- return NULL;
- } else {
- // Need one space for the length
- char * buf = (char *)malloc((len+1));
- unsigned char lowb=len;
- buf[0]=lowb;
- memcpy(buf+1, aString, len);
- return buf;
- }
- break;
- case NDB_TYPE_LONGVARCHAR:
- case NDB_TYPE_LONGVARBINARY:
- {
- char* buff=(char *)malloc(len+2);
-
- short l = (short)len;
- /*
- We need to copy the length of our string into the first 2 bytes
- of the buffer.
- We take a bitwise AND of the 1st byte in the short 'l' and copy
- it int the 1st byte of our buffer.
- */
-
- buff[0]=(unsigned char) ((l & 0x00FF))>>0;
- /*
- We take a bitwise AND of the 2nd byte in the short 'l'
- and copy it into the 2nd byte of our buffer.
- */
-
- buff[1]= (unsigned char)((l & 0xFF00)>>8);
- memcpy(&buff[2],aString, l);
- return buff;
- }
- break;
- case NDB_TYPE_CHAR:
- if (len>255) {
- return NULL;
- } else {
- int colLength = theColumn->getLength();
- char * buf = (char *)malloc(colLength+1);
- memset(buf,32, colLength);
- memcpy(buf, aString, len);
- return buf;
- }
- break;
- case NDB_TYPE_BINARY:
- if (len>255) {
- return NULL;
- } else {
- int colLength = theColumn->getLength();
- char * buf = (char *)malloc(colLength+1);
- memset(buf, 0, colLength);
- memcpy(buf, aString, len);
- return buf;
- }
- break;
- default:
- return NULL;
- }
- }
-
- Uint64 ndbFormatDateTime(const NdbDictColumn * theColumn, NdbDateTime * tm) {
-
- // Returns 1 on failure. How much does that suck?
-
- char dt_buf[20];
- Uint64 val = 0;
- switch(theColumn->getType()) {
- case NDB_TYPE_DATETIME:
- case NDB_TYPE_TIMESTAMP:
- {
- snprintf(dt_buf, 20, "%04d%02d%02d%02d%02d%02d",
- tm->year, tm->month, tm->day, tm->hour, tm->minute, tm->second);
- val=strtoull(dt_buf, 0, 10);
- }
- break;
- case NDB_TYPE_TIME:
- {
- snprintf(dt_buf, 20, "%02d%02d%02d",
- tm->hour, tm->minute, tm->second);
- val=strtoull(dt_buf, 0, 10);
- }
- break;
- case NDB_TYPE_DATE:
- {
- val=(tm->year << 9) | (tm->month << 5) | tm->day;
- //int3store(dt_buf, val);
- }
- break;
- default:
- return 1;
- }
- return val;
- }
-
-
-
- %}
-
-%rename(NdbObject) NdbDictObject;
-%rename(NdbTable) NdbDictTable;
-%rename(NdbColumn) NdbDictColumn;
-%rename(NdbIndex) NdbDictIndex;
-%rename(NdbDictionary) NdbDictDictionary;
-%rename(NdbEvent) NdbDictEvent;
-
-/* Do this here so we can override it in the Java interface */
-%rename(Ndb_cluster_connection) NdbClusterConnection;
-
-long long getMicroTime();
-
-
-enum AbortOption {
- CommitIfFailFree = 0,
- TryCommit = 0,
- AbortOnError = 0,
- CommitAsMuchAsPossible = 2,
- AO_IgnoreError = 2
-};
-
-enum ExecType {
- NoExecTypeDef = -1,
- Prepare = 0,
- NoCommit = 1,
- Commit = 2,
- Rollback = 3
-};
-
-typedef void (* NdbAsynchCallback)(int, NdbTransaction*, void*);
-typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
-
-typedef const char * NdbDatetime;
-typedef const char * NdbDate;
-typedef const char * NdbTime;
-typedef Uint32 NdbTimestamp;
-
-// ndbFormatString mallocs memory. Return value must be free'd by calling code
-%newobject ndbformatString;
-%typemap(newfree) char * "free($1);";
-
-%ndbexception("NdbApiException") {
- $action
- if (result==NULL) {
- NDB_exception(NdbApiException,"Error Converting Argument Type!");
- }
- }
-char * ndbFormatString(const NdbDictColumn * theColumn,
- const char* aString, size_t len);
-
-%ndbnoexception;
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.2 branch (monty:2630) | Monty Taylor | 18 Jun |