Case-change string functions: Correctly set byteLength of the result (Pending)

Attention

This behavior change is in the 2026_04 bundle.

For the current status of the bundle, refer to Bundle history.

This behavior change fixes the byte length of the result type for the UPPER and INITCAP functions. These functions can produce a result whose character length is up to 3 times the input’s character length, because certain characters can expand into multiple characters when their case changes (for example, the German sharp s ß becomes SS). Before this fix, the result type’s character length was correctly tripled but the byte length was left at the input’s byte length, which could be too small to hold the actual output when non-ASCII characters were involved.

Before the change:

When UPPER or INITCAP appeared in a select list, the result type’s length was tripled but its byteLength was copied from the input. For example, UPPER(col) where col is VARCHAR(10) with byteLength = 40 produced VARCHAR(30) with byteLength = 40. In the common ASCII case this didn’t cause visible issues, but with non-ASCII data the stale byteLength was too small for the actual output and could lead to query failures downstream.

After the change:

The byteLength of the result type is recomputed from the new character length, so the function always has enough room to hold the actual output. For UPPER(col) where col is VARCHAR(10) with byteLength = 40, the result is now typed VARCHAR(30) with byteLength = 120.

This change applies to new query compilations only. Tables and views that were created before the change keep the byte length they were materialized with. If you encounter byte-length-related downstream failures on a pre-existing table, contact Snowflake Support for assistance.

Ref: 2317