Bug #8315 NdbScanFilter cmp method only works for strings of exact word boundry length
Submitted: 4 Feb 2005 13:11 Modified: 5 Feb 2005 21:33
Reporter: Martin Skold
Status: Closed
Category:Server: Cluster Severity:S2 (Serious)
Version:5.0 OS:
Assigned to: Martin Skold Target Version:

[4 Feb 2005 13:11] Martin Skold
Description:
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);