Skip to content

Commit

Permalink
remove buf.len > varchar_max condition in tds sender function
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
  • Loading branch information
Sandeep Kumawat committed Dec 28, 2023
1 parent 994628f commit 7e2c037
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions contrib/babelfishpg_tds/src/backend/tds/tdstypeio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2782,9 +2782,6 @@ TdsSendTypeVarchar(FmgrInfo *finfo, Datum value, void *vMetaData)
}
else
{
/* We can store upto 2GB (2^31 - 1 bytes) for the varchar(max). */
if (unlikely(actualLen > VARCHAR_MAX))
elog(ERROR, "Number of bytes required for the field of varchar(max) exeeds 2GB");
TDSInstrumentation(INSTR_TDS_DATATYPE_VARCHAR_MAX);

rc = TdsSendPlpDataHelper(destBuf, actualLen);
Expand Down Expand Up @@ -2980,9 +2977,6 @@ TdsSendTypeNVarchar(FmgrInfo *finfo, Datum value, void *vMetaData)
}
else
{
/* We can store upto 2GB (2^31 - 1 bytes) for the nvarchar(max). */
if (unlikely(buf.len > VARCHAR_MAX))
elog(ERROR, "Number of bytes required for the field of nvarchar(max) exeeds 2GB");
TDSInstrumentation(INSTR_TDS_DATATYPE_NVARCHAR_MAX);

rc = TdsSendPlpDataHelper(buf.data, buf.len);
Expand Down

0 comments on commit 7e2c037

Please sign in to comment.