mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:37:45 +00:00
SQLServer: Use m_client_id instead of client_id in callback
In the DatabaseConnection constructor, there's a deferred_invoke callback that references the client_id. But depending on when the callback occurs, the reference of the client_id can change. This created a problem when connecting to SQLServer using the SQL utility because depending on when the callback was invoked, the client_id could change. m_client_id is set in the constructor and that reference will not change depending on when the callback is invoked.
This commit is contained in:
parent
9a4c1c019a
commit
e4f040147f
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
|
||||||
deferred_invoke([&](Object&) {
|
deferred_invoke([&](Object&) {
|
||||||
m_database = SQL::Database::construct(String::formatted("/home/anon/sql/{}.db", m_database_name));
|
m_database = SQL::Database::construct(String::formatted("/home/anon/sql/{}.db", m_database_name));
|
||||||
m_accept_statements = true;
|
m_accept_statements = true;
|
||||||
auto client_connection = ClientConnection::client_connection_for(client_id);
|
auto client_connection = ClientConnection::client_connection_for(m_client_id);
|
||||||
if (client_connection)
|
if (client_connection)
|
||||||
client_connection->async_connected(m_connection_id);
|
client_connection->async_connected(m_connection_id);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue