knex / knex

A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.
https://knexjs.org/
MIT License
19.17k stars 2.11k forks source link

MSSQL client connect on PostgreSQL server doesnt throw Error , but crashing whole server #6106

Open danilesky opened 1 month ago

danilesky commented 1 month ago

Environment

Knex version: 3.1.0 Database + version: PostgreSQL / MSSQL OS: MacOS

Select applicable template from below. If issue is about oracledb support, tag @ atiertant. For MSSql tag @ smorey2. Rest of dialects don't need tags. If issue is about TypeScript definitions, tag @ lorefnon.

Bug

@smorey2

Hello, i have an weird issue with using mssql client with knex. I allow my clients to switch between database manually. The issue come when client make an mistake and try ti connect with mssql client on some postgresql database, not backwards or any other only this one , with MSSQL client to PostgreSQL server accidentally. It will crash whole server without catching error , i tried try catch but it always crash the server.

Error : Socket hang up.

Thank you for response

danilesky commented 1 month ago

Also there is problem if you connecting with mssql to existing database but with wrong password , you cannot escape errors