Sometimes the NDBAPI is not perhaps the most straightforward.
This might be useful if you are struggling with scan filters
(filtering tuples in the ndbd kernel, like
engine-condition-pushdown) in combination with strings. Please
have a look at my previous blog about how to use strings in the
NDBAPI.
If you are using string daratypes with the NdbScanFilter::COND_EQ
then the following rules applies:
- VARCHAR and VARBINARY strings must have their length prepended (1 or 2 bytes)
- CHAR must be space padded
- BINARY must be null byte padded
However, for NdbScanFilter::COND_LIKE the following
applies:
- VARCHAR and VARBINARY must NOThave the lenght prepended!
- CHAR must NOT be space padded
- BINARY must NOT be null byte padded
Many thanks to Pekka (MySQL) and Jim Dowling (MySQL) on this subject.