List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:July 2 2010 9:06am
Subject:bzr commit into mysql-5.1-telco-7.0-spj branch (ole.john.aske:3199)
View as plain text  
#At file:///net/fimafeng09/export/home/tmp/oleja/mysql/mysql-5.1-telco-7.0-spj/ based on revid:ole.john.aske@stripped

 3199 Ole John Aske	2010-07-02
      Changed ::readTable(), ::scanTable() and ::scanIndex() to return a 'const' object.
      
      After introducing an 'Options' object as argument to ::readTable(), ::scanTable() 
      and ::scanIndex(), all information for defining the NdbQueryOperationDef are available
      at once when the object is created. It is therefore possible to restrict these
      objects to be const.

    modified:
      storage/ndb/include/ndbapi/NdbQueryBuilder.hpp
      storage/ndb/src/ndbapi/NdbQueryBuilder.cpp
      storage/ndb/test/include/HugoQueryBuilder.hpp
      storage/ndb/test/src/HugoQueryBuilder.cpp
      storage/ndb/test/tools/spj_performance_test.cpp
=== modified file 'storage/ndb/include/ndbapi/NdbQueryBuilder.hpp'
--- a/storage/ndb/include/ndbapi/NdbQueryBuilder.hpp	2010-07-01 14:15:49 +0000
+++ b/storage/ndb/include/ndbapi/NdbQueryBuilder.hpp	2010-07-02 09:06:49 +0000
@@ -372,25 +372,25 @@ public:
   // Each NdbQueryOperationDef will also be assigned an numeric ident (starting from 0)
   // as an alternative way of locating the NdbQueryOperation.
   
-  NdbQueryLookupOperationDef* readTuple(
+  const NdbQueryLookupOperationDef* readTuple(
                                 const NdbDictionary::Table*,          // Primary key lookup
 				const NdbQueryOperand* const keys[],  // Terminated by NULL element 
                                 const NdbQueryOptions* options = 0,
                                 const char* ident = 0);
 
-  NdbQueryLookupOperationDef* readTuple(
+  const NdbQueryLookupOperationDef* readTuple(
                                 const NdbDictionary::Index*,          // Unique key lookup w/ index
 			        const NdbDictionary::Table*,
 				const NdbQueryOperand* const keys[],  // Terminated by NULL element 
                                 const NdbQueryOptions* options = 0,
                                 const char* ident = 0);
 
-  NdbQueryTableScanOperationDef* scanTable(
+  const NdbQueryTableScanOperationDef* scanTable(
                                 const NdbDictionary::Table*,
                                 const NdbQueryOptions* options = 0,
                                 const char* ident = 0);
 
-  NdbQueryIndexScanOperationDef* scanIndex(
+  const NdbQueryIndexScanOperationDef* scanIndex(
                                 const NdbDictionary::Index*, 
 	                        const NdbDictionary::Table*,
                                 const NdbQueryIndexBound* bound = 0,

=== modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp	2010-07-01 14:15:49 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp	2010-07-02 09:06:49 +0000
@@ -689,7 +689,7 @@ NdbQueryBuilder::linkedValue(const NdbQu
   return &linkedOp->m_interface;
 }
 
-NdbQueryLookupOperationDef*
+const NdbQueryLookupOperationDef*
 NdbQueryBuilder::readTuple(const NdbDictionary::Table* table,    // Primary key lookup
                            const NdbQueryOperand* const keys[],  // Terminated by NULL element 
                            const NdbQueryOptions* options,
@@ -749,7 +749,7 @@ NdbQueryBuilder::readTuple(const NdbDict
 }
 
 
-NdbQueryLookupOperationDef*
+const NdbQueryLookupOperationDef*
 NdbQueryBuilder::readTuple(const NdbDictionary::Index* index,    // Unique key lookup w/ index
                            const NdbDictionary::Table* table,    // Primary key lookup
                            const NdbQueryOperand* const keys[],  // Terminated by NULL element 
@@ -813,7 +813,7 @@ NdbQueryBuilder::readTuple(const NdbDict
 }
 
 
-NdbQueryTableScanOperationDef*
+const NdbQueryTableScanOperationDef*
 NdbQueryBuilder::scanTable(const NdbDictionary::Table* table,
                            const NdbQueryOptions* options,
                            const char* ident)
@@ -834,7 +834,7 @@ NdbQueryBuilder::scanTable(const NdbDict
 }
 
 
-NdbQueryIndexScanOperationDef*
+const NdbQueryIndexScanOperationDef*
 NdbQueryBuilder::scanIndex(const NdbDictionary::Index* index, 
 	                   const NdbDictionary::Table* table,
                            const NdbQueryIndexBound* bound,

=== modified file 'storage/ndb/test/include/HugoQueryBuilder.hpp'
--- a/storage/ndb/test/include/HugoQueryBuilder.hpp	2010-05-12 07:23:07 +0000
+++ b/storage/ndb/test/include/HugoQueryBuilder.hpp	2010-07-02 09:06:49 +0000
@@ -136,7 +136,7 @@ private:
   {
     int m_parent;
     int m_idx;
-    NdbQueryOperationDef * m_op;
+    const NdbQueryOperationDef * m_op;
   };
 
   Vector<Op> m_query; // Query built sofar
@@ -151,7 +151,7 @@ private:
   Vector<Op> getParents(OpIdx); //
   NdbQueryOperand * createLink(NdbQueryBuilder&, const NdbDictionary::Column*,
                                Vector<Op> & parents);
-  NdbQueryOperationDef* createOp(NdbQueryBuilder&);
+  const NdbQueryOperationDef* createOp(NdbQueryBuilder&);
 
   void fixOptions();
 };

=== modified file 'storage/ndb/test/src/HugoQueryBuilder.cpp'
--- a/storage/ndb/test/src/HugoQueryBuilder.cpp	2010-05-11 20:12:03 +0000
+++ b/storage/ndb/test/src/HugoQueryBuilder.cpp	2010-07-02 09:06:49 +0000
@@ -306,7 +306,7 @@ found:
   return ret;
 }
 
-NdbQueryOperationDef*
+const NdbQueryOperationDef*
 HugoQueryBuilder::createOp(NdbQueryBuilder& builder)
 {
   struct Op op;
@@ -408,7 +408,7 @@ HugoQueryBuilder::createQuery(Ndb* pNdb,
       clearOption(O_PK_INDEX);
       clearOption(O_UNIQUE_INDEX);
     }
-    NdbQueryOperationDef * rootOp = createOp(builder);
+    const NdbQueryOperationDef * rootOp = createOp(builder);
     assert(rootOp != 0);
     m_options = save;
   }

=== modified file 'storage/ndb/test/tools/spj_performance_test.cpp'
--- a/storage/ndb/test/tools/spj_performance_test.cpp	2010-01-06 21:11:41 +0000
+++ b/storage/ndb/test/tools/spj_performance_test.cpp	2010-07-02 09:06:49 +0000
@@ -246,7 +246,7 @@ void TestThread::doLinkedAPITest(){
       if(queryDef != NULL){
         queryDef->release();
       }
-      NdbQueryOperationDef* parentOpDef = NULL;
+      const NdbQueryOperationDef* parentOpDef = NULL;
       if(m_params->m_scanLength==0){
         // Root is lookup
         const NdbQueryOperand* rootKey[] = {  


Attachment: [text/bzr-bundle] bzr/ole.john.aske@sun.com-20100702090649-ro6lhgjrk6eu7o8d.bundle
Thread
bzr commit into mysql-5.1-telco-7.0-spj branch (ole.john.aske:3199) Ole John Aske2 Jul