Classic Engine Evaluation Semantics (vs. failing SBE Semantics):
- If 'input' is nullish, return a null value (SBE - checked in the builtinTrim function)
- else if 'input' is not null but is a non-string value, throw an error (SBE - throws an error assuming previous condition is validated)
- else if 'chars' is not provided, trim with default whitespace characters (SBE - trims with default whitespace characters)
- else if 'chars' is provided and null, return a null value (SBE INCORRECT - treats this as the same as not providing it at all)
- else if 'chars' is provided and not a string, throw an error (SBE - throws an error)
- else perform trim on 'input' with 'chars' (SBE - trims with 'chars')
Fix: Treat null 'chars' as different from no 'chars' given and make sure null 'input' is checking before !isString (completed)
- related to
-
SERVER-79595 Add C++ benchmarks for $trunc, $trim, and $strLenBytes
- Closed