Bug #8315 NdbScanFilter cmp method only works for strings of exact word boundry length
Submitted: 4 Feb 2005 12:11 Modified: 5 Feb 2005 20:33
Reporter: Martin Skold Email Updates:
Status: Closed Impact on me:
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.0 OS:
Assigned to: Martin Skold CPU Architecture:Any

[4 Feb 2005 12:11] Martin Skold
If defining an attribute CHAR of VARCHAR of length of uneven word length
the comparison function in NdbScanFilter will never work. This is because one
has to pass the exact length in the API, but the kernel uses the rounded size
when doing the actual interpretation of the comparision operation.

How to repeat:
Define an an attribute CHAR(10) and define scan filter for it.

Suggested fix:
The kernel has to round it up if not already done:

	  if ((((argLen + 3) >> 2) << 2) == attrLen) argLen= attrLen;
	  res = (*sqlType.m_cmp)(cs, s1, attrLen, s2, argLen, true);