From bad836352d34e8372a71c612cd6660798922ec07 Mon Sep 17 00:00:00 2001 From: silverqx Date: Thu, 7 Mar 2024 18:33:29 +0100 Subject: [PATCH] drivers added/updated comment --- drivers/common/src/orm/drivers/sqlquery.cpp | 2 +- drivers/mysql/src/orm/drivers/mysql/mysqldriver.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/common/src/orm/drivers/sqlquery.cpp b/drivers/common/src/orm/drivers/sqlquery.cpp index 765b70c78..7f2f6d258 100644 --- a/drivers/common/src/orm/drivers/sqlquery.cpp +++ b/drivers/common/src/orm/drivers/sqlquery.cpp @@ -438,7 +438,7 @@ void SqlQuery::clear() // Ownership of a weak_ptr() const auto driver = driverWeakInternal(); - // Get the SqlResult instance + // Get a new empty SqlResult instance *this = SqlQuery(driver.lock()->createResult(driver)); } diff --git a/drivers/mysql/src/orm/drivers/mysql/mysqldriver.cpp b/drivers/mysql/src/orm/drivers/mysql/mysqldriver.cpp index 14a00f842..724724eaf 100644 --- a/drivers/mysql/src/orm/drivers/mysql/mysqldriver.cpp +++ b/drivers/mysql/src/orm/drivers/mysql/mysqldriver.cpp @@ -204,7 +204,11 @@ MySqlDriver::createResult(const std::weak_ptr &driver) const /* We need to upcast here, there is no other way, it also has to be std::weak_ptr(), it can't be done better. This upcast is kind of check, we can't pass down the SqlDriver to the MySqlResult. - Even if it would be the shared_ptr we had to upcast the same way. */ + Even if it would be the shared_ptr we had to upcast the same way. + Revisited, also, all driver data members like host, port, username, ..., and + also connectionName will be still the same, it only creates an empty result + set. I'm noting this because of SqlQuery::clear() as it was confusing that + all these data members stay unchanged, but it's correct. */ return std::make_unique( std::dynamic_pointer_cast(driverShared));