Commit c2e13da2 authored by unknown's avatar unknown
Browse files

Bug#5429

Use const table * in NDB API


ndb/include/ndbapi/Ndb.hpp:
  Removed useFullyQualifiedNames(bool)
  Changed so that auto increment methods takes const pointer
ndb/include/ndbapi/NdbBlob.hpp:
  Changed to const table pointer
ndb/include/ndbapi/NdbConnection.hpp:
  Changed to const table pointer
ndb/include/ndbapi/NdbIndexOperation.hpp:
  Changed to const table pointer
ndb/include/ndbapi/NdbOperation.hpp:
  Changed to const table pointer
ndb/include/ndbapi/NdbScanOperation.hpp:
  Changed to const table pointer
ndb/src/kernel/blocks/backup/restore/Restore.cpp:
  Corrected size & array size in case of blob usage
ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp:
  Removed use fully qualified name
  Handle blob tables
ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp:
  Introduced mapping between old/new table (wrt ids)
ndb/src/kernel/blocks/backup/restore/main.cpp:
  removed extra Uint32
ndb/src/ndbapi/Ndb.cpp:
  Changed to const table pointer
ndb/src/ndbapi/NdbConnection.cpp:
  Changed to const table pointer
ndb/src/ndbapi/NdbIndexOperation.cpp:
  Changed to const table pointer
ndb/src/ndbapi/NdbOperation.cpp:
  Changed to const table pointer
ndb/src/ndbapi/NdbScanOperation.cpp:
  Changed to const table pointer
sql/ha_ndbcluster.cc:
  Changed to const table pointer
parent 18068991
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -1363,15 +1363,6 @@ public:
   */
  static void setConnectString(const char * connectString);

  /**
   * useFullyQualifiedNames
   * Enables unique name space for different databases and schemas
   * by defining table names as DATABASENAME/SCHEMANAME/TABLENAME and
   * index names as DATABASENAME/SCHEMANAME/TABLENAME/INDEXNAME
   * @param turnNamingOn bool true - turn naming on, false - turn naming off
   */
  void useFullyQualifiedNames(bool turnNamingOn = true);

  bool usingFullyQualifiedNames();

  /** @} *********************************************************************/
@@ -1422,13 +1413,13 @@ public:
   */
  Uint64 getAutoIncrementValue(const char* aTableName, 
			       Uint32 cacheSize = 1);
  Uint64 getAutoIncrementValue(NdbDictionary::Table * aTable, 
  Uint64 getAutoIncrementValue(const NdbDictionary::Table * aTable, 
			       Uint32 cacheSize = 1);
  Uint64 readAutoIncrementValue(const char* aTableName);
  Uint64 readAutoIncrementValue(NdbDictionary::Table * aTable);
  Uint64 readAutoIncrementValue(const NdbDictionary::Table * aTable);
  bool setAutoIncrementValue(const char* aTableName, Uint64 val, 
			     bool increase = false);
  bool setAutoIncrementValue(NdbDictionary::Table * aTable, Uint64 val, 
  bool setAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 val, 
			     bool increase = false);
  Uint64 getTupleIdFromNdb(const char* aTableName, 
			   Uint32 cacheSize = 1000);
+3 −3
Original line number Diff line number Diff line
@@ -238,9 +238,9 @@ private:
  Ndb* theNdb;
  NdbConnection* theNdbCon;
  NdbOperation* theNdbOp;
  NdbTableImpl* theTable;
  NdbTableImpl* theAccessTable;
  NdbTableImpl* theBlobTable;
  const NdbTableImpl* theTable;
  const NdbTableImpl* theAccessTable;
  const NdbTableImpl* theBlobTable;
  const NdbColumnImpl* theColumn;
  char theFillChar;
  // sizes
+13 −13
Original line number Diff line number Diff line
@@ -442,12 +442,12 @@ public:
  int executePendingBlobOps(Uint8 flags = 0xFF);

  // Fast path calls for MySQL ha_ndbcluster
  NdbOperation* getNdbOperation(NdbDictionary::Table * table);
  NdbIndexOperation* getNdbIndexOperation(NdbDictionary::Index * index,
					  NdbDictionary::Table * table);
  NdbScanOperation* getNdbScanOperation(NdbDictionary::Table * table);
  NdbIndexScanOperation* getNdbIndexScanOperation(NdbDictionary::Index * index,
						  NdbDictionary::Table * table);
  NdbOperation* getNdbOperation(const NdbDictionary::Table * table);
  NdbIndexOperation* getNdbIndexOperation(const NdbDictionary::Index *,
					  const NdbDictionary::Table * table);
  NdbScanOperation* getNdbScanOperation(const NdbDictionary::Table * table);
  NdbIndexScanOperation* getNdbIndexScanOperation(const NdbDictionary::Index * index,
						  const NdbDictionary::Table * table);
  
private:						
  /**
@@ -556,14 +556,14 @@ private:
  void		setOperationErrorCodeAbort(int anErrorCode);

  int		checkMagicNumber();		       // Verify correct object
  NdbOperation* getNdbOperation(class NdbTableImpl* aTable,
  NdbOperation* getNdbOperation(const class NdbTableImpl* aTable,
                                NdbOperation* aNextOp = 0);
  NdbIndexScanOperation* getNdbScanOperation(class NdbTableImpl* aTable);
  NdbIndexOperation* getNdbIndexOperation(class NdbIndexImpl* anIndex, 
                                          class NdbTableImpl* aTable,
  NdbIndexScanOperation* getNdbScanOperation(const class NdbTableImpl* aTable);
  NdbIndexOperation* getNdbIndexOperation(const class NdbIndexImpl* anIndex, 
                                          const class NdbTableImpl* aTable,
                                          NdbOperation* aNextOp = 0);
  NdbIndexScanOperation* getNdbIndexScanOperation(NdbIndexImpl* index,
						  NdbTableImpl* table);
  NdbIndexScanOperation* getNdbIndexScanOperation(const NdbIndexImpl* index,
						  const NdbTableImpl* table);
  
  void		handleExecuteCompletion();
  
+3 −3
Original line number Diff line number Diff line
@@ -175,15 +175,15 @@ private:
  int executeCursor(int ProcessorId);

  // Overloaded methods from NdbCursorOperation
  int indxInit(class NdbIndexImpl* anIndex,
	       class NdbTableImpl* aTable, 
  int indxInit(const class NdbIndexImpl* anIndex,
	       const class NdbTableImpl* aTable, 
	       NdbConnection* myConnection);

  int equal_impl(const class NdbColumnImpl*, const char* aValue, Uint32 len);
  int prepareSend(Uint32  TC_ConnectPtr, Uint64  TransactionId);

  // Private attributes
  NdbIndexImpl* m_theIndex;
  const NdbIndexImpl* m_theIndex;
  Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3];
  Uint32 m_theIndexLen;	  	 // Length of the index in words
  Uint32 m_theNoOfIndexDefined;  // The number of index attributes
+3 −3
Original line number Diff line number Diff line
@@ -709,7 +709,7 @@ protected:
//--------------------------------------------------------------
// Initialise after allocating operation to a transaction		      
//--------------------------------------------------------------
  int init(class NdbTableImpl*, NdbConnection* aCon);
  int init(const class NdbTableImpl*, NdbConnection* aCon);
  void initInterpreter();

  void	next(NdbOperation*);		// Set next pointer		      
@@ -858,8 +858,8 @@ protected:
  Uint32*           theKEYINFOptr;       // Pointer to where to write KEYINFO
  Uint32*           theATTRINFOptr;      // Pointer to where to write ATTRINFO

  class NdbTableImpl* m_currentTable;      // The current table
  class NdbTableImpl* m_accessTable;
  const class NdbTableImpl* m_currentTable;      // The current table
  const class NdbTableImpl* m_accessTable;

  // Set to TRUE when a tuple key attribute has been defined. 
  Uint32	    theTupleKeyDefined[NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY][3];
Loading