List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:August 19 2007 9:35pm
Subject:Re: NdbScanFilter with strings
View as plain text  
Hey,

So in my NdbScanFilter.i, I never pass anything in to the length param
(letting the default value of 0 stand)

And then I do this:

int cmpString(NdbOperation * op, BinaryCondition cond, int ColId, const
char * anInputString, size_t len ) {
    const NdbDictionary::Column * theColumn =
op->getTable()->getColumn(ColId);
    char * stringVal = ndbFormatString(theColumn,anInputString,len);
    if (stringVal == NULL)
      return -1;
    int retval = self->cmp(cond,ColId,(void *)stringVal);
    free(stringVal);
    return retval;
  };

where ndbFormatString returns the whole length-byte-string thing.

I'm not 100% I've tested this, though. But I think I remember talking to
Johan about it at the time...

John David Duncan wrote:
> Hi folks,
> 
> I'm stumped trying to get the C++ NdbScanFilter::cmp() to work with a
> string.
> 
> Does anyone have a working example?
> If the column is a varchar do you pass the string with the length byte
> first?
> What do you put in the length parameter?
> 
> Thanks,
> 
> JD
> 
> 
> 


-- 
Monty Taylor
Senior Consultant
MySQL Inc., www.mysql.com
Get More with MySQL!  www.mysql.com/consulting
Thread
NdbScanFilter with stringsJohn David Duncan19 Aug
  • Re: NdbScanFilter with stringsMonty Taylor19 Aug
    • Re: NdbScanFilter with stringsJohn David Duncan20 Aug
      • Re: NdbScanFilter with stringsFrazer Clement20 Aug
        • Re: NdbScanFilter with stringsJohn David Duncan22 Aug
          • Re: NdbScanFilter with stringsMonty Taylor22 Aug
            • Re: NdbScanFilter with stringsJohn David Duncan22 Aug
              • Re: NdbScanFilter with stringsMonty Taylor22 Aug
              • Re: NdbScanFilter with stringsMonty Taylor30 Aug
                • Re: NdbScanFilter with stringsJohn David Duncan30 Aug
                  • Re: NdbScanFilter with stringsMonty Taylor30 Aug