MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:November 22 2006 2:42pm
Subject:bk commit into 5.0 tree (jonas:1.2271) BUG#24503
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-22 15:42:03+01:00, jonas@stripped +5 -0
  ndb - bug#24503
    Fix scan filter on bit types
    (note should probably be enabled in condition pushdown aswell)

  ndb/src/common/util/NdbSqlUtil.cpp@stripped, 2006-11-22 15:42:02+01:00, jonas@stripped +21 -7
    Add support for comparing bit types

  ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2006-11-22 15:42:02+01:00, jonas@stripped +1 -0
    Add new error code

  ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp@stripped, 2006-11-22 15:42:02+01:00, jonas@stripped +5 -0
    Add new error code

  ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2006-11-22 15:42:02+01:00, jonas@stripped +10 -0
    Add correct handling of unsupported type

  ndb/src/ndbapi/ndberror.c@stripped, 2006-11-22 15:42:02+01:00, jonas@stripped +1 -0
    Add new error code

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/50-work

--- 1.31/ndb/src/common/util/NdbSqlUtil.cpp	2006-11-22 15:42:07 +01:00
+++ 1.32/ndb/src/common/util/NdbSqlUtil.cpp	2006-11-22 15:42:07 +01:00
@@ -136,7 +136,7 @@
   },
   { // 22
     Type::Bit,
-    NULL,
+    cmpBit,
     NULL
   },
   { // 23
@@ -679,6 +679,26 @@
 }
 
 int
+NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
+{ 
+  Uint32 n = (n1 < n2) ? n1 : n2;
+  char* c1 = (char*)p1;
+  char* c2 = (char*)p2;
+  int ret = memcmp(p1, p2, n);
+  printf(" p1: ");
+  for (Uint32 i = 0; i<n1; i++)
+    printf("%d ", c1[i]);
+
+  printf(" p2: ");
+  for (Uint32 i = 0; i<n2; i++)
+    printf("%d ", c2[i]);
+
+  ndbout_c(" -> %d", ret);
+  return ret;
+}
+
+
+int
 NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
 {
   if (n2 >= 3) {
@@ -698,12 +718,6 @@
 }
 
 // not yet
-int
-NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
-{
-  assert(false);
-  return 0;
-}
 
 int
 NdbSqlUtil::cmpLongvarchar(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)

--- 1.27/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2006-11-22 15:42:07 +01:00
+++ 1.28/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2006-11-22 15:42:07 +01:00
@@ -196,6 +196,7 @@
 #define ZTRY_TO_UPDATE_ERROR 888
 #define ZCALL_ERROR 890
 #define ZTEMPORARY_RESOURCE_FAILURE 891
+#define ZUNSUPPORTED_BRANCH 892
 
 #define ZSTORED_SEIZE_ATTRINBUFREC_ERROR 873 // Part of Scan
 

--- 1.2/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp	2006-11-22 15:42:07 +01:00
+++ 1.3/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp	2006-11-22 15:42:07 +01:00
@@ -444,6 +444,11 @@
     }//if
     break;
 
+  case 40:
+    ljam();
+    terrorCode = ZUNSUPPORTED_BRANCH;
+    break;
+    
   default:
     ndbrequire(false);
     break;

--- 1.21/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2006-11-22 15:42:07 +01:00
+++ 1.22/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2006-11-22 15:42:07 +01:00
@@ -1876,6 +1876,11 @@
             // NULL==NULL and NULL<not-NULL
             res1 = r1_null && r2_null ? 0 : r1_null ? -1 : 1;
           } else {
+	    jam();
+	    if (unlikely(sqlType.m_cmp == 0))
+	    {
+	      return TUPKEY_abort(signal, 40);
+	    }
             res1 = (*sqlType.m_cmp)(cs, s1, attrLen, s2, argLen, true);
           }
 	} else {
@@ -1883,6 +1888,11 @@
             // NULL like NULL is true (has no practical use)
             res1 =  r1_null && r2_null ? 0 : -1;
           } else {
+	    jam();
+	    if (unlikely(sqlType.m_like == 0))
+	    {
+	      return TUPKEY_abort(signal, 40);
+	    }
             res1 = (*sqlType.m_like)(cs, s1, attrLen, s2, argLen);
           }
         }

--- 1.46/ndb/src/ndbapi/ndberror.c	2006-11-22 15:42:07 +01:00
+++ 1.47/ndb/src/ndbapi/ndberror.c	2006-11-22 15:42:07 +01:00
@@ -278,6 +278,7 @@
   { 885,  AE, "Stack underflow in interpreter" },
   { 886,  AE, "More than 65535 instructions executed in interpreter" },
   { 897,  AE, "Update attempt of primary key via ndbcluster internal api (if this occurs via the MySQL server it is a bug, please report)" },
+  { 892,  AE, "Unsupported type in scan filter" },
   { 4256, AE, "Must call Ndb::init() before this function" },
   { 4257, AE, "Tried to read too much - too many getValue calls" },
   
Thread
bk commit into 5.0 tree (jonas:1.2271) BUG#24503jonas22 Nov