Stop using names for logical operators in MySQL backend

This was inconsistent with the rest of the SOCI code (and sometimes with
the operators in the same line!) and required including <iso646> with
MSVC which still doesn't support operator names without it, but this
header is removed in C++20, so including it is undesirable.
This commit is contained in:
Vadim Zeitlin
2025-05-25 21:27:06 +02:00
parent 26475c2ca8
commit 13970220e5
2 changed files with 6 additions and 6 deletions

View File

@@ -275,7 +275,7 @@ void parse_connect_string(const string & connectString,
*password = val;
*password_p = true;
}
else if ((par == "db" || par == "dbname" || par == "service") and !*db_p)
else if ((par == "db" || par == "dbname" || par == "service") && !*db_p)
{
*db = val;
*db_p = true;

View File

@@ -153,9 +153,9 @@ mysql_statement_backend::execute(int number)
}
std::string query;
if (not useByPosBuffers_.empty() or not useByNameBuffers_.empty())
if (!useByPosBuffers_.empty() || !useByNameBuffers_.empty())
{
if (not useByPosBuffers_.empty() and not useByNameBuffers_.empty())
if (!useByPosBuffers_.empty() && !useByNameBuffers_.empty())
{
throw soci_error(
"Binding for use elements must be either by position "
@@ -166,7 +166,7 @@ mysql_statement_backend::execute(int number)
{
std::vector<char *> paramValues;
if (not useByPosBuffers_.empty())
if (!useByPosBuffers_.empty())
{
// use elements bind by position
// the map of use buffers can be traversed
@@ -202,7 +202,7 @@ mysql_statement_backend::execute(int number)
//cerr << "queryChunks_.size(): "<<queryChunks_.size()<<endl;
//cerr << "paramValues.size(): "<<paramValues.size()<<endl;
if (queryChunks_.size() != paramValues.size()
and queryChunks_.size() != paramValues.size() + 1)
&& queryChunks_.size() != paramValues.size() + 1)
{
throw soci_error("Wrong number of parameters.");
}
@@ -266,7 +266,7 @@ mysql_statement_backend::execute(int number)
mysql_errno(session_.conn_));
}
result_ = mysql_store_result(session_.conn_);
if (result_ == NULL and mysql_field_count(session_.conn_) != 0)
if (result_ == NULL && mysql_field_count(session_.conn_) != 0)
{
throw mysql_soci_error(mysql_error(session_.conn_),
mysql_errno(session_.conn_));