List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:April 27 2007 10:55pm
Subject:Rev 86: Changed perl/test.pl to use NdbFactory::createNdbClusterConnection and NdbClusterConnection::getNdb in http://bazaar.launchpad.net/~ndb-connec...
View as plain text  
------------------------------------------------------------
revno: 86
revision-id: monty@stripped
parent: monty@stripped
committer: Monty Taylor <monty@stripped>
branch nick: devel
timestamp: Fri 2007-04-27 15:54:17 -0700
message:
  Changed perl/test.pl to use NdbFactory::createNdbClusterConnection and
NdbClusterConnection::getNdb
  Reorged NdbFactory C++ class since gcc was complaining.
modified:
  perl/test.pl                  
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-perl5%2ftest.pl
  swig/NdbFactory.i              ndbfactory.i-20070427052328-bwn5ewzrbigsg9v5-1
=== modified file 'perl/test.pl'
--- a/perl/test.pl	2007-04-25 20:55:51 +0000
+++ b/perl/test.pl	2007-04-27 22:54:17 +0000
@@ -52,7 +52,7 @@
 
 print "connecting to cluster\n";
 
-$connection = new mysql::cluster::ndbapi::Ndb_cluster_connection();
+$connection = mysql::cluster::ndbapi::NdbFactory::createNdbClusterConnection();
 
 
 if ($connection->connect(5,3,1)) {
@@ -67,7 +67,7 @@
     exit -1;
 } else { print "cluster ready\n"; }
 
-$myNdb = new mysql::cluster::ndbapi::Ndb($connection,"test");
+$myNdb = $connection->getNdb("test");
 
 
 if ($myNdb->init(4) == -1) {

=== modified file 'swig/NdbFactory.i'
--- a/swig/NdbFactory.i	2007-04-27 05:23:30 +0000
+++ b/swig/NdbFactory.i	2007-04-27 22:54:17 +0000
@@ -23,14 +23,17 @@
 class NdbFactory
 {
 public:
-  static Ndb_cluster_connection * createNdbClusterConnection(const char * connectString =
0);
-};
-
-static Ndb_cluster_connection * NdbFactory::createNdbClusterConnection(const char *
connectString = 0)
+static Ndb_cluster_connection * createNdbClusterConnection()
+{
+  return new Ndb_cluster_connection();
+}
+static Ndb_cluster_connection * createNdbClusterConnection(const char * connectString)
 {
   return new Ndb_cluster_connection(connectString);
 }
 
+};
+
 %}
 
 class NdbFactory

Thread
Rev 86: Changed perl/test.pl to use NdbFactory::createNdbClusterConnection and NdbClusterConnection::getNdb in http://bazaar.launchpad.net/~ndb-connec...Monty Taylor28 Apr