Skip to content

[Bug]: ISNULL function returns no response in some scenarios #4506

@Teletele-Lin

Description

@Teletele-Lin

What happened?

It looks like ISNULL is getting stuck when executing; it just hangs and returns nothing.

DECLARE @val VARCHAR(3) = NULL;
SELECT ISNULL(@val, 'Hello World');

Version

BABEL_5_X_DEV (Default)

Extension

babelfishpg_tsql (Default)

Which flavor of Linux are you using when you see the bug?

Ubuntu (Default)

Relevant log output

2026-02-02 12:20:46.832 CST [63829] ERROR:  Number of bytes for the field of varchar(n) exeeds max specified for the field.
2026-02-02 12:20:46.832 CST [63829] CONTEXT:  PL/tsql function inline_code_block line 2 at SQL statement
        TDS Protocol: Message Type: SQL BATCH, Phase: TDS_REQUEST_PHASE_PROCESS. Writing the Tds response to the socket
2026-02-02 12:20:46.832 CST [63829] LOG:  Unmapped error found. Code: 2600, Message: Number of bytes for the field of varchar(n) exeeds max specified for the field., File: tdstypeio.c, Line: 2766, Context: TDS
2026-02-02 12:20:46.832 CST [63829] CONTEXT:  TDS Protocol: Message Type: SQL BATCH, Phase: TDS_REQUEST_PHASE_PROCESS. Writing the Tds response to the socket
2026-02-02 12:21:21.105 CST [66613] LOG:  EOF on TDS socket

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions