List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:August 30 2007 6:47am
Subject:Rev 143: Added test for COND_LIKE, since that takes a different length parameter. (thanks again JD) in http://bazaar.launchpad.net/~ndb-connectors/nd...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 143
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Wed 2007-08-29 23:46:51 -0700
message:
  Added test for COND_LIKE, since that takes a different length parameter. (thanks again
JD) 
modified:
  swig/NdbScanFilter.i           ndbscanfilter.i-20070521223726-lvjwmtu5b6uvgsft-1
=== modified file 'swig/NdbScanFilter.i'
--- a/swig/NdbScanFilter.i	2007-08-30 05:34:54 +0000
+++ b/swig/NdbScanFilter.i	2007-08-30 06:46:51 +0000
@@ -242,9 +242,14 @@
     if (stringVal == NULL) 
       return -1;
 
-    Uint32 cmpLength = cmpGetColumnLength(theColumn);
-    if (cmpLength == 0) 
-      return -1;
+    Uint32 cmpLength = 0; 
+    if (cond == NdbScanFilter::COND_EQ) { 
+      cmpLength = cmpGetColumnLength(theColumn);
+      if (cmpLength == 0) 
+	return -1;
+    } else if ((cond == NdbScanFilter::COND_LIKE) || (cond ==
NdbScanFilter::COND_NOT_LIKE)) { 
+      cmpLength = (Uint32)len;
+    }
 
     int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
     free(stringVal);
@@ -256,9 +261,14 @@
     if (stringVal == NULL) 
       return -1;
 
-    Uint32 cmpLength = cmpGetColumnLength(theColumn);
-    if (cmpLength == 0) 
-      return -1;
+    Uint32 cmpLength = 0; 
+    if (cond == NdbScanFilter::COND_EQ) { 
+      cmpLength = cmpGetColumnLength(theColumn);
+      if (cmpLength == 0) 
+	return -1;
+    } else if ((cond == NdbScanFilter::COND_LIKE) || (cond ==
NdbScanFilter::COND_NOT_LIKE)) {
+      cmpLength = (Uint32)len;
+    }
 
     int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
     free(stringVal);
@@ -344,9 +354,14 @@
     if (stringVal == NULL) 
       return -1;
 
-    Uint32 cmpLength = cmpGetColumnLength(theColumn);
-    if (cmpLength == 0) 
-      return -1;
+    Uint32 cmpLength = 0; 
+    if (cond == NdbScanFilter::COND_EQ) { 
+      cmpLength = cmpGetColumnLength(theColumn);
+      if (cmpLength == 0) 
+	return -1;
+    } else if ((cond == NdbScanFilter::COND_LIKE) || (cond ==
NdbScanFilter::COND_NOT_LIKE)) {
+      cmpLength = (Uint32)len;
+    }
 
     int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
     free(stringVal);
@@ -361,10 +376,14 @@
     char * stringVal = ndbFormatString(theColumn,anInputString,len);
     if (stringVal == NULL) 
       return -1;
-    Uint32 cmpLength = cmpGetColumnLength(theColumn);
-    if (cmpLength == 0) 
-      return -1;
-    
+    Uint32 cmpLength = 0; 
+    if (cond == NdbScanFilter::COND_EQ) { 
+      cmpLength = cmpGetColumnLength(theColumn);
+      if (cmpLength == 0) 
+	return -1;
+    } else if ((cond == NdbScanFilter::COND_LIKE) || (cond ==
NdbScanFilter::COND_NOT_LIKE)) {
+      cmpLength = (Uint32)len;
+    }
     int retval = self->cmp(cond,ColId,(void *)stringVal,cmpLength);
     free(stringVal);
     return retval;

Thread
Rev 143: Added test for COND_LIKE, since that takes a different length parameter. (thanks again JD) in http://bazaar.launchpad.net/~ndb-connectors/nd...Monty Taylor30 Aug