Fix integration tests

This commit is contained in:
Konstantin Bogdanov 2024-04-26 19:56:24 +02:00
parent 466633729f
commit 822a57cb83
Signed by: thevar1able
GPG Key ID: DB399448D9FE52F1
3 changed files with 4 additions and 3 deletions

View File

@ -368,7 +368,7 @@ void Session::authenticate(const Credentials & credentials_, const Poco::Net::So
void Session::isUserStillValid() void Session::isUserStillValid()
{ {
if (user->valid_until) if (user && user->valid_until)
{ {
const time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); const time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());

View File

@ -54,7 +54,7 @@ public:
void authenticate(const Credentials & credentials_, const Poco::Net::SocketAddress & address_); void authenticate(const Credentials & credentials_, const Poco::Net::SocketAddress & address_);
// Checks if user valid_until is less than current time. // Checks if user valid_until is less than current time.
// Throws exception otherwise. // Throws exception if valid_until is higher than current time.
void isUserStillValid(); void isUserStillValid();
/// Writes a row about login failure into session log (if enabled) /// Writes a row about login failure into session log (if enabled)

View File

@ -415,6 +415,7 @@ void TCPHandler::runImpl()
CurrentThread::attachInternalProfileEventsQueue(state.profile_queue); CurrentThread::attachInternalProfileEventsQueue(state.profile_queue);
} }
if (!is_interserver_mode)
session->isUserStillValid(); session->isUserStillValid();
query_context->setExternalTablesInitializer([this] (ContextPtr context) query_context->setExternalTablesInitializer([this] (ContextPtr context)