Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
RowProtocol::rangeCheck() takes the target type name as const SQLString&, and all callers pass a string literal ("int32_t", "int16_t", "Byte", "uint32_t"). Each call therefore builds a temporary SQLString, which means one heap allocation and one deallocation per value read. The name is only used to build the error message when the value is out of range.
Affected getters:
Text protocol: getInt(), getShort(), getByte(), getUInt() on every call.
Binary protocol: the same getters, except getInt() on a signed INT/MEDIUMINT column, which returns before the range check.
Fix: pass the type name as const char*. There is no behaviour change and the error message is identical.