babelfish-for-postgresql / babelfish_extensions

Babelfish for PostgreSQL provides the capability for PostgreSQL to work with applications written for Microsoft SQL Server. Babelfish understands the SQL Server wire-protocol and T-SQL, the Microsoft SQL Server query and procedural language, so you don’t have to switch database drivers or rewrite all of your application queries.
https://babelfishpg.org/
Apache License 2.0
265 stars 87 forks source link

[Bug]: Crash when reporting an error after varbinary cast #2693

Open staticlibs opened 6 days ago

staticlibs commented 6 days ago

What happened?

The following snippet caused the crash:

create view v1 as select cast('a' as varbinary)
go
create view v1 as select cast('a' as varbinary)
go

Crash happens when error context callback is called when reporting relation "v1" already exists error.

AFAICS varbinary coerce code path fails to pop the error context stack, will file a PR (to engine) shortly.

Version

BABEL_4_X_DEV (Default)

Extension

None

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

Fedora

Relevant log output

024-06-27 23:52:34.716 IST [125825] LOG:  server process (PID 126090) was terminated by signal 11: Segmentation fault
2024-06-27 23:52:34.716 IST [125825] DETAIL:  Failed process was running: 
    create view v1 as select cast('a' as varbinary)
2024-06-27 23:52:34.716 IST [125825] LOG:  terminating any other active server processes
2024-06-27 23:52:34.717 IST [125825] LOG:  all server processes terminated; reinitializing
2024-06-27 23:52:34.769 IST [126102] LOG:  database system was interrupted; last known up at 2024-06-27 23:50:52 IST

Code of Conduct