You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeDecoder is an object that allocates buffers and VDF structs once per
expression and reuses them across rows.
It writes directly into the caller-provided String *out (following
MySQL's val_str(String *buf) convention) and sets it to point at the
scratch buffer — zero copies on the hot path. The returned pointer is
valid until the next decode() call, which is sufficient for the protocol
send path.
val_external_str on both Field and Item now fills the buffer argument
and returns it, consistent with val_str. One-shot decodes outside the
row-reading path (e.g. Item_string::print()) use DecodeStringUncached.
For the mem_root selection on Field: regular tables (NO_TMP_TABLE) use
TABLE::mem_root, giving the decoder the same lifetime as its Field clone
and avoiding orphaned allocations on the share. All temp table variants
use TABLE_SHARE::mem_root because close_tmp_table() asserts
TABLE::mem_root is empty — this covers both INTERNAL_TMP_TABLE and
derived/CTE tables, which are initialized as INTERNAL_TMP_TABLE but
overwritten to NON_TRANSACTIONAL_TMP_TABLE by sql_derived.cc.
0 commit comments