List:Commits« Previous MessageNext Message »
From:Jan Wedvik Date:November 2 2010 11:37am
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jan.wedvik:3335
to 3336)
View as plain text  
 3336 Jan Wedvik	2010-11-02
      This commit intends to get rid of the following compiler warnings:
      
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp: 3663
      	'int formatAttr(const NdbColumnImpl*, const void*&, Uint32&, char*, Uint32)' declared 'static' but never defined
      storage/ndb/test/tools/spj_sanity_test.cpp: 618
      	dereferencing type-punned pointer will break strict-aliasing rules
      storage/ndb/test/tools/spj_sanity_test.cpp: 705
      	dereferencing type-punned pointer will break strict-aliasing rules
      storage/ndb/test/tools/spj_sanity_test.cpp: 765
      	dereferencing type-punned pointer will break strict-aliasing rules
      storage/ndb/test/tools/spj_sanity_test.cpp: 866
      	dereferencing type-punned pointer will break strict-aliasing rules
      libmysqld/ha_ndbcluster.cc: 1855
      	array subscript is above array bounds
      libmysqld/ha_ndbcluster.cc: 1879
      	array subscript is above array bounds

    modified:
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/test/tools/spj_sanity_test.cpp
 3335 Jan Wedvik	2010-11-01
      This commit changes the spj_sanity_test to use varchar data types (rather than
      integer), to test NdbConstOperand for varchar fields.

    modified:
      storage/ndb/test/tools/spj_sanity_test.cpp
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2010-11-01 12:32:15 +0000
+++ b/sql/ha_ndbcluster.cc	2010-11-02 11:36:28 +0000
@@ -1863,7 +1863,7 @@ ha_ndbcluster::check_if_pushable(const N
     break;
 
   case NdbQueryOperationDef::TableScan:
-    DBUG_ASSERT (idx==MAX_KEY);
+    DBUG_ASSERT (idx==0);
     if (needSorted)
     {
       DBUG_PRINT("info", 

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2010-11-01 12:32:15 +0000
+++ b/sql/ha_ndbcluster.h	2010-11-02 11:36:28 +0000
@@ -702,7 +702,7 @@ private:
   bool check_index_fields_not_null(KEY *key_info);
 
   bool check_if_pushable(const NdbQueryOperationTypeWrapper& type,
-                         uint idx= MAX_KEY,
+                         uint idx= 0,
 			 bool rootSorted= false) const;
   bool check_is_pushed() const;
   int create_pushed_join(NdbQueryParamValue* paramValues, uint paramOffs= 0);

=== modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2010-11-01 12:38:37 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2010-11-02 11:36:28 +0000
@@ -3659,11 +3659,6 @@ NdbQueryOperationImpl::serializeProject(
   return 0;
 } // NdbQueryOperationImpl::serializeProject
 
-static int
-formatAttr(const NdbColumnImpl* column,
-           const void* &value, Uint32& len,
-           char* buffer, Uint32 buflen);
-
 int NdbQueryOperationImpl::serializeParams(const NdbQueryParamValue* paramValues)
 {
   if (unlikely(paramValues == NULL))

=== modified file 'storage/ndb/test/tools/spj_sanity_test.cpp'
--- a/storage/ndb/test/tools/spj_sanity_test.cpp	2010-11-01 12:42:22 +0000
+++ b/storage/ndb/test/tools/spj_sanity_test.cpp	2010-11-02 11:36:28 +0000
@@ -302,7 +302,12 @@ namespace SPJSanityTest{
     Vector<Operation*> m_children;
     const NdbQueryOperationDef* m_operationDef;
     // For now, only setResultRowRef() style result retrieval is tested.
-    const Row* m_resultPtr;
+    union
+    {
+      const Row* m_resultPtr;
+      // Use union to avoid strict-aliasing problems.
+      const char* m_resultCharPtr;
+    };
     // Corresponds to NdbQueryOperationDef operation numbering
     Uint32 m_operationId;
     // Number among siblings.
@@ -614,8 +619,7 @@ namespace SPJSanityTest{
     NdbQueryOperation* queryOp 
       = m_query.getOperation(m_operationId);
     queryOp->setResultRowRef(m_query.getNdbRecord(), 
-                             //*ptr,
-                             reinterpret_cast<const char*&>(m_resultPtr),
+                             m_resultCharPtr,
                              NULL);
   }
 
@@ -701,8 +705,7 @@ namespace SPJSanityTest{
     NdbQueryOperation* queryOp 
       = m_query.getOperation(m_operationId);
     queryOp->setResultRowRef(m_query.getNdbRecord(), 
-                             //*ptr,
-                             reinterpret_cast<const char*&>(m_resultPtr),
+                             m_resultCharPtr,
                              NULL);
   }
 
@@ -761,8 +764,7 @@ namespace SPJSanityTest{
     NdbQueryOperation* queryOp 
       = m_query.getOperation(m_operationId);
     queryOp->setResultRowRef(m_query.getNdbRecord(), 
-                             //*ptr,
-                             reinterpret_cast<const char*&>(m_resultPtr),
+                             m_resultCharPtr,
                              NULL);
     if(m_lessThanRow!=-1){
       NdbInterpretedCode code(queryOp->getQueryOperationDef().getTable());
@@ -862,8 +864,7 @@ namespace SPJSanityTest{
     NdbQueryOperation* queryOp 
       = m_query.getOperation(m_operationId);
     queryOp->setResultRowRef(m_query.getNdbRecord(), 
-                             //*ptr,
-                             reinterpret_cast<const char*&>(m_resultPtr),
+                             m_resultCharPtr,
                              NULL);
   }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jan.wedvik:3335to 3336) Jan Wedvik2 Nov