From ae51dc9c1373756abd21a552c293f7c6f0b66f73 Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Fri, 10 May 2024 15:48:13 -0400 Subject: [PATCH] tds_check_column_extra: Skip size check for BLOBs. Let column_size exceed column_cur_size for BLOBs, whose reported maximum may have been merely nominal, and doesn't really matter because their storage is generally allocated separately, based on actual result sizes. Signed-off-by: Aaron M. Ucko --- src/tds/tds_checks.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tds/tds_checks.c b/src/tds/tds_checks.c index c027666032..bd19361590 100644 --- a/src/tds/tds_checks.c +++ b/src/tds/tds_checks.c @@ -235,7 +235,15 @@ tds_check_column_extra(const TDSCOLUMN * column) assert(varint_ok); assert(!is_numeric_type(column->column_type)); - assert(column->column_cur_size <= column->column_size); + if (!is_blob_type(column->column_type)) { + /* + * Skip for BLOBs, whose reported maximum may have + * been merely nominal, and doesn't really matter + * because their storage is generally allocated + * separately, based on actual result sizes. + */ + assert(column->column_cur_size <= column->column_size); + } /* check size of fixed type correct */ size = tds_get_size_by_type(column->column_type);