List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:May 9 2012 8:40am
Subject:bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3918 to 3919)
View as plain text  
 3919 magnus.blaudd@stripped	2012-05-09
      ndb
       - add small test program and build it against ndbclient_static

    added:
      storage/ndb/src/ndbclient_link_test.cpp
    modified:
      storage/ndb/src/CMakeLists.txt
 3918 magnus.blaudd@stripped	2012-05-09
      ndb
       - Change ndbclient_exports.cpp to use a function instead of 'array of
         function pointers' since this is more flexible 
       - Add copyright header and comment

    modified:
      storage/ndb/src/ndbclient_exports.cpp
=== modified file 'storage/ndb/src/CMakeLists.txt'
--- a/storage/ndb/src/CMakeLists.txt	2012-05-09 06:16:47 +0000
+++ b/storage/ndb/src/CMakeLists.txt	2012-05-09 07:59:21 +0000
@@ -38,7 +38,13 @@ SET(NDBCLIENT_LIBS
                 ndbgeneral
                 ndbconf)
 
+#
+# Build static ndbclient library
+#
 MERGE_LIBRARIES(ndbclient_static STATIC ${NDBCLIENT_LIBS} COMPONENT Development)
+# Build test program to check linking against ndclient_static
+ADD_EXECUTABLE(ndbclient_static_link_test ndbclient_link_test.cpp)
+TARGET_LINK_LIBRARIES(ndbclient_static_link_test ndbclient_static)
 
 #
 # Do a shared libd

=== added file 'storage/ndb/src/ndbclient_link_test.cpp'
--- a/storage/ndb/src/ndbclient_link_test.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbclient_link_test.cpp	2012-05-09 07:59:21 +0000
@@ -0,0 +1,54 @@
+/*
+   Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+*/
+
+#include "../include/ndbapi/NdbApi.hpp"
+#include <stdio.h>
+
+int main(int argc, const char**)
+{
+  if (argc < 0)
+  {
+    /*
+      NOTE! This code should not run, it's sole purpose is
+      to check that the public functions of the NdbApi etc. can be
+      found in the ndbclient libraries
+    */
+    (void)ndb_init();
+    Ndb_cluster_connection cluster_con;
+    Ndb ndb(&cluster_con);
+    NdbDictionary::Table tab("");
+    NdbDictionary::Index idx("");
+    NdbTransaction* trans = ndb.startTransaction();
+    NdbOperation* op = trans->getNdbOperation(&tab);
+    NdbRecAttr* rec_attr = op->getValue("");
+    rec_attr->isNULL();
+    NdbScanOperation* sop = trans->getNdbScanOperation(&tab);
+    sop->readTuples();
+    NdbIndexScanOperation* isop = trans->getNdbIndexScanOperation(&idx);
+    isop->get_range_no();
+    NdbIndexOperation* iop = trans->getNdbIndexOperation(&idx);
+    iop->insertTuple();
+    NdbScanFilter scan_filter(op);
+    NdbIndexStat index_stat;
+    NdbInterpretedCode interpreted_code;
+    NdbEventOperation* eop = ndb.createEventOperation("");
+    eop->isConsistent();
+    NdbBlob* blob = op->getBlobHandle("");
+    blob->truncate();
+    ndb_end(0);
+  }
+}

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3918 to 3919) magnus.blaudd9 May