mirror of
https://github.com/mariadb-corporation/mariadb-connector-cpp.git
synced 2026-01-13 20:13:06 +00:00
Some small changes not to be lost
This commit is contained in:
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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!");
|
||||
|
||||
Reference in New Issue
Block a user