summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi
diff options
context:
space:
mode:
authorunknown <mskold@mysql.com>2005-02-16 23:16:02 +0100
committerunknown <mskold@mysql.com>2005-02-16 23:16:02 +0100
commit4161264789013bd700e55cd8596d21fe3e27a9fc (patch)
tree3d6e1cd435c8e1094a014a4bf3bd47cc3b673795 /ndb/src/ndbapi
parent1acae43e43b320246b03b678fecc6a74cb361822 (diff)
parentde5fa1dc3396dee1bf5fba06bcbd2b482946bcae (diff)
downloadmariadb-git-4161264789013bd700e55cd8596d21fe3e27a9fc.tar.gz
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb sql/ha_ndbcluster.cc: Auto merged sql/item.h: Auto merged
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r--ndb/src/ndbapi/Ndb.cpp4
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp11
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp3
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp20
-rw-r--r--ndb/src/ndbapi/NdbTransaction.cpp8
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp5
-rw-r--r--ndb/src/ndbapi/TransporterFacade.hpp3
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection.cpp2
8 files changed, 45 insertions, 11 deletions
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 59d1e45ca46..b047ae1bd1a 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -84,7 +84,9 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
} else if (TretCode != 0) {
tAnyAlive= 1;
}//if
- DBUG_PRINT("info",("tried node %d TretCode %d", tNode, TretCode));
+ DBUG_PRINT("info",("tried node %d, TretCode %d, error code %d, %s",
+ tNode, TretCode, getNdbError().code,
+ getNdbError().message));
}
}
else // just do a regular round robin
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index 346f5de9eb5..664d568aee0 100644
--- a/ndb/src/ndbapi/NdbDictionary.cpp
+++ b/ndb/src/ndbapi/NdbDictionary.cpp
@@ -948,8 +948,17 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
case NdbDictionary::Column::Double:
out << "Double";
break;
+ case NdbDictionary::Column::Olddecimal:
+ out << "Olddecimal(" << col.getPrecision() << "," << col.getScale() << ")";
+ break;
+ case NdbDictionary::Column::Olddecimalunsigned:
+ out << "Olddecimalunsigned(" << col.getPrecision() << "," << col.getScale() << ")";
+ break;
case NdbDictionary::Column::Decimal:
- out << "Decimal(" << col.getScale() << "," << col.getPrecision() << ")";
+ out << "Decimal(" << col.getPrecision() << "," << col.getScale() << ")";
+ break;
+ case NdbDictionary::Column::Decimalunsigned:
+ out << "Decimalunsigned(" << col.getPrecision() << "," << col.getScale() << ")";
break;
case NdbDictionary::Column::Char:
out << "Char(" << col.getLength() << ";" << csname << ")";
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 9236c3ef321..b144ae917fa 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -109,7 +109,10 @@ NdbColumnImpl::init(Type t)
m_length = 1;
m_cs = NULL;
break;
+ case Olddecimal:
+ case Olddecimalunsigned:
case Decimal:
+ case Decimalunsigned:
m_precision = 10;
m_scale = 0;
m_length = 1;
diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp
index 85b08c0cfa4..86a777e79d2 100644
--- a/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -178,7 +178,8 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
return out;
}
- uint length = r.getColumn()->getLength();
+ const NdbDictionary::Column* c = r.getColumn();
+ uint length = c->getLength();
if (length > 1)
out << "[";
@@ -237,6 +238,22 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
case NdbDictionary::Column::Double:
out << r.double_value();
break;
+ case NdbDictionary::Column::Olddecimal:
+ {
+ short len = 1 + c->getPrecision() + (c->getScale() > 0);
+ out.print("%.*s", len, r.aRef());
+ }
+ break;
+ case NdbDictionary::Column::Olddecimalunsigned:
+ {
+ short len = 0 + c->getPrecision() + (c->getScale() > 0);
+ out.print("%.*s", len, r.aRef());
+ }
+ break;
+ case NdbDictionary::Column::Decimal:
+ case NdbDictionary::Column::Decimalunsigned:
+ goto unknown; // TODO
+ break;
// for dates cut-and-paste from field.cc
case NdbDictionary::Column::Datetime:
{
@@ -346,6 +363,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
j = length;
}
break;
+ unknown:
default: /* no print functions for the rest, just print type */
out << (int) r.getType();
j = length;
diff --git a/ndb/src/ndbapi/NdbTransaction.cpp b/ndb/src/ndbapi/NdbTransaction.cpp
index ab6c0ca3e38..67581e4a0f8 100644
--- a/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/ndb/src/ndbapi/NdbTransaction.cpp
@@ -1420,14 +1420,18 @@ Remark: Sets TC Connect pointer.
int
NdbTransaction::receiveTCSEIZEREF(NdbApiSignal* aSignal)
{
+ DBUG_ENTER("NdbTransaction::receiveTCSEIZEREF");
if (theStatus != Connecting)
{
- return -1;
+ DBUG_RETURN(-1);
} else
{
theStatus = ConnectFailure;
theNdb->theError.code = aSignal->readData(2);
- return 0;
+ DBUG_PRINT("info",("error code %d, %s",
+ theNdb->getNdbError().code,
+ theNdb->getNdbError().message));
+ DBUG_RETURN(0);
}
}//NdbTransaction::receiveTCSEIZEREF()
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index 5b5394f0965..7f1e68a42d3 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -466,8 +466,7 @@ void TransporterFacade::threadMainReceive(void)
theTransporterRegistry->stopReceiving();
}
-TransporterFacade::TransporterFacade(NdbMgmHandle mgm_handle) :
- m_mgm_handle(mgm_handle),
+TransporterFacade::TransporterFacade() :
theTransporterRegistry(0),
theStopReceive(0),
theSendThread(NULL),
@@ -496,7 +495,7 @@ bool
TransporterFacade::init(Uint32 nodeId, const ndb_mgm_configuration* props)
{
theOwnId = nodeId;
- theTransporterRegistry = new TransporterRegistry(m_mgm_handle,this);
+ theTransporterRegistry = new TransporterRegistry(this);
const int res = IPCConfig::configureTransporters(nodeId,
* props,
diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp
index bd3fc67a8d6..e74f4b51e00 100644
--- a/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/ndb/src/ndbapi/TransporterFacade.hpp
@@ -47,7 +47,7 @@ extern "C" {
class TransporterFacade
{
public:
- TransporterFacade(NdbMgmHandle mgm_handle);
+ TransporterFacade();
virtual ~TransporterFacade();
bool init(Uint32, const ndb_mgm_configuration *);
@@ -133,7 +133,6 @@ private:
bool isConnected(NodeId aNodeId);
void doStop();
- NdbMgmHandle m_mgm_handle;
TransporterRegistry* theTransporterRegistry;
SocketServer m_socket_server;
int sendPerformedLastInterval;
diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp
index 4a33be7c597..e6f5d464d80 100644
--- a/ndb/src/ndbapi/ndb_cluster_connection.cpp
+++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp
@@ -284,7 +284,7 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
m_transporter_facade=
TransporterFacade::theFacadeInstance=
- new TransporterFacade(m_config_retriever->get_mgmHandle());
+ new TransporterFacade();
DBUG_VOID_RETURN;
}