Some small changes not to be lost

This commit is contained in:
Lawrin Novitsky
2024-08-26 10:42:44 +02:00
parent 0d6790d011
commit c953dd3858
5 changed files with 17 additions and 12 deletions

View File

@ -75,6 +75,12 @@ public:
}
};
//StopTimer::Duration operator +(const StopTimer& op1, const StopTimer& op2)
//{
// return static_cast<StopTimer::Duration>(op1) + static_cast<StopTimer::Duration>(op2);
//}
// A small extension - with ttl and method to say if it's over
class Timer : public StopTimer
{
@ -180,7 +186,7 @@ public:
{
sum+= it;
}
return sum;//std::accumulate(data.begin(), data.end(), Duration(0));
return sum;// std::accumulate(data.begin(), data.end(), Duration(0));
}
// Expected value

View File

@ -193,7 +193,7 @@ namespace mariadb
*/
void SelectResultSet::addStreamingValue(bool cacheLocally) {
int32_t fetchSizeTmp = fetchSize;
int32_t fetchSizeTmp= fetchSize;
while (fetchSizeTmp > 0 && readNextValue(cacheLocally)) {
--fetchSizeTmp;
}

View File

@ -369,13 +369,13 @@ namespace capi
/** Grow data array. */
void SelectResultSetBin::growDataArray() {
std::size_t curSize = data.size();
std::size_t curSize= data.size();
if (data.capacity() < curSize + 1) {
uint64_t newCapacity = static_cast<uint64_t>(curSize + (curSize >> 1));
uint64_t newCapacity= static_cast<uint64_t>(curSize + (curSize >> 1));
if (newCapacity > MAX_ARRAY_SIZE) {
newCapacity = MAX_ARRAY_SIZE;
newCapacity= MAX_ARRAY_SIZE;
}
data.reserve(newCapacity);

View File

@ -245,12 +245,11 @@ namespace mariadb
queryException= addHostInformationToException(queryException,protocol);
bool killCmd =
bool killCmd=
queryException.empty() != true
&&queryException.getSQLState().empty() != true
&&(queryException.getSQLState().compare("70100") == 0)
&&1927= queryException.getErrorCode();
&& queryException.getSQLState().empty() != true
&& (queryException.getSQLState().compare("70100") == 0)
&& 1927= queryException.getErrorCode();
if (killCmd){
handleFailOver(queryException,method,args,protocol,isClosed);

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* 2024 MariaDB Corporation plc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2.0, as
@ -678,10 +679,9 @@ void StatementTest::testGetMoreResults01()
bool moreResVal=stmt->getMoreResults();
// Hmm... smth is wrong here. Bad test
if ((moreResVal == true) || (moreResVal == false)) {
if ((moreResVal == true) || (moreResVal == false && stmt->getUpdateCount() != -1)) {
TestsListener::messagesLog()
<< "getMoreResults method returns :" << moreResVal << std::endl;
TestsListener::setTestExecutionComment("This test needs to be changed or removed. It's wrong");
} else {
logErr(" getMoreResults method returns a invalid value");
FAIL("Call to getMoreResults is Failed!");