v.24.10Improvement
Allow TRIM -ing LEADING or TRAILING empty string as no-op
AllowTRIM-ingLEADINGorTRAILINGempty string as a no-op. Closes #67792. #68455 (Peter Nguyen).
Why it matters
This feature addresses the issue where usingTRIM with LEADING or TRAILING and an empty string caused unexpected behavior. By treating trimming an empty string as a no-op, it prevents errors and aligns behavior with user expectations, improving query stability and usability.How to use it
Users can simply use theTRIM function with LEADING or TRAILING and specify an empty string as the trim string. For example:SELECT TRIM(LEADING '' FROM ' example ');This will now act as a no-op without error.