fixes for macos/clang

This commit is contained in:
Günter Obiltschnig
2020-01-09 11:53:03 +01:00
parent 1bf40a0cd2
commit 03d1dd9822
41 changed files with 389 additions and 1317 deletions

View File

@@ -91,8 +91,6 @@ void Binder::bind(std::size_t pos, const Poco::UInt64& val, Direction dir)
}
#ifndef POCO_LONG_IS_64_BIT
void Binder::bind(std::size_t pos, const long& val, Direction dir)
{
poco_assert(dir == PD_IN);
@@ -106,8 +104,6 @@ void Binder::bind(std::size_t pos, const unsigned long& val, Direction dir)
realBind(pos, MYSQL_TYPE_LONG, &val, 0, true);
}
#endif // POCO_LONG_IS_64_BIT
void Binder::bind(std::size_t pos, const bool& val, Direction dir)
{
@@ -115,7 +111,7 @@ void Binder::bind(std::size_t pos, const bool& val, Direction dir)
realBind(pos, MYSQL_TYPE_TINY, &val, 0);
}
void Binder::bind(std::size_t pos, const float& val, Direction dir)
{
poco_assert(dir == PD_IN);
@@ -268,7 +264,7 @@ MYSQL_BIND* Binder::getBindArray() const
///////////////////
//
// Private
// Private
//
////////////////////
@@ -293,7 +289,7 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Int8>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Int8>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -305,13 +301,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Int8>& val, Direction
}
void Binder::bind(std::size_t pos, const std::list<Poco::Int8>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Int8>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt8>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt8>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -323,13 +319,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::UInt8>& val, Direction
}
void Binder::bind(std::size_t pos, const std::list<Poco::UInt8>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::UInt8>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Int16>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Int16>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -341,13 +337,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Int16>& val, Direction
}
void Binder::bind(std::size_t pos, const std::list<Poco::Int16>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Int16>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt16>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt16>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -359,13 +355,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::UInt16>& val, Directio
}
void Binder::bind(std::size_t pos, const std::list<Poco::UInt16>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::UInt16>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -377,13 +373,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Int32>& val, Direction
}
void Binder::bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -395,13 +391,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::UInt32>& val, Directio
}
void Binder::bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -413,13 +409,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Int64>& val, Direction
}
void Binder::bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -431,13 +427,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::UInt64>& val, Directio
}
void Binder::bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<bool>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<bool>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -449,13 +445,13 @@ void Binder::bind(std::size_t pos, const std::deque<bool>& val, Direction dir)
}
void Binder::bind(std::size_t pos, const std::list<bool>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<bool>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<float>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<float>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -467,13 +463,13 @@ void Binder::bind(std::size_t pos, const std::deque<float>& val, Direction dir)
}
void Binder::bind(std::size_t pos, const std::list<float>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<float>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<double>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<double>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -485,13 +481,13 @@ void Binder::bind(std::size_t pos, const std::deque<double>& val, Direction dir)
}
void Binder::bind(std::size_t pos, const std::list<double>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<double>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<char>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<char>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -503,13 +499,13 @@ void Binder::bind(std::size_t pos, const std::deque<char>& val, Direction dir)
}
void Binder::bind(std::size_t pos, const std::list<char>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<char>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::BLOB>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::BLOB>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -521,13 +517,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Data::BLOB>& val, Dire
}
void Binder::bind(std::size_t pos, const std::list<Poco::Data::BLOB>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Data::BLOB>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::CLOB>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::CLOB>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -539,13 +535,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Data::CLOB>& val, Dire
}
void Binder::bind(std::size_t pos, const std::list<Poco::Data::CLOB>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Data::CLOB>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::DateTime>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::DateTime>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -557,13 +553,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::DateTime>& val, Direct
}
void Binder::bind(std::size_t pos, const std::list<Poco::DateTime>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::DateTime>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::Date>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::Date>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -575,13 +571,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Data::Date>& val, Dire
}
void Binder::bind(std::size_t pos, const std::list<Poco::Data::Date>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Data::Date>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::Time>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::Time>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -593,13 +589,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Data::Time>& val, Dire
}
void Binder::bind(std::size_t pos, const std::list<Poco::Data::Time>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Data::Time>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::NullData>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::NullData>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -611,13 +607,13 @@ void Binder::bind(std::size_t pos, const std::deque<Poco::Data::NullData>& val,
}
void Binder::bind(std::size_t pos, const std::list<Poco::Data::NullData>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<Poco::Data::NullData>& val, Direction dir)
{
throw NotImplementedException();
}
void Binder::bind(std::size_t pos, const std::vector<std::string>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::vector<std::string>& val, Direction dir)
{
throw NotImplementedException();
}
@@ -629,7 +625,7 @@ void Binder::bind(std::size_t pos, const std::deque<std::string>& val, Direction
}
void Binder::bind(std::size_t pos, const std::list<std::string>& val, Direction dir)
void Binder::bind(std::size_t pos, const std::list<std::string>& val, Direction dir)
{
throw NotImplementedException();
}

View File

@@ -80,7 +80,6 @@ bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
}
#ifndef POCO_LONG_IS_64_BIT
bool Extractor::extract(std::size_t pos, long& val)
{
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val);
@@ -91,7 +90,6 @@ bool Extractor::extract(std::size_t pos, unsigned long& val)
{
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val, true);
}
#endif
bool Extractor::extract(std::size_t pos, bool& val)
@@ -105,32 +103,32 @@ bool Extractor::extract(std::size_t pos, float& val)
return realExtractFixed(pos, MYSQL_TYPE_FLOAT, &val);
}
bool Extractor::extract(std::size_t pos, double& val)
{
return realExtractFixed(pos, MYSQL_TYPE_DOUBLE, &val);
}
bool Extractor::extract(std::size_t pos, char& val)
{
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
}
bool Extractor::extract(std::size_t pos, std::string& val)
{
if (_metadata.columnsReturned() <= pos)
throw MySQLException("Extractor: attempt to extract more parameters, than query result contain");
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
return false;
//mysql reports TEXT types as FDT_BLOB when being extracted
MetaColumn::ColumnDataType columnType = _metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type();
if (columnType != Poco::Data::MetaColumn::FDT_STRING && columnType != Poco::Data::MetaColumn::FDT_BLOB)
throw MySQLException("Extractor: not a string");
val.assign(reinterpret_cast<const char*>(_metadata.rawData(pos)), _metadata.length(pos));
return true;
}
@@ -140,13 +138,13 @@ bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
{
if (_metadata.columnsReturned() <= pos)
throw MySQLException("Extractor: attempt to extract more parameters, than query result contain");
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
return false;
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB)
throw MySQLException("Extractor: not a blob");
val.assignRaw(_metadata.rawData(pos), _metadata.length(pos));
return true;
}
@@ -156,13 +154,13 @@ bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
{
if (_metadata.columnsReturned() <= pos)
throw MySQLException("Extractor: attempt to extract more parameters, than query result contain");
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
return false;
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB)
throw MySQLException("Extractor: not a blob");
val.assignRaw(reinterpret_cast<const char*>(_metadata.rawData(pos)), _metadata.length(pos));
return true;
}
@@ -244,7 +242,7 @@ bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* b
bind.buffer_type = type;
bind.buffer = buffer;
bind.is_unsigned = isUnsigned;
if (!_stmt.fetchColumn(pos, &bind))
return false;
@@ -273,8 +271,8 @@ bool Extractor::extract(std::size_t , std::list<Poco::Int8>& )
{
throw NotImplementedException("std::list extractor must be implemented.");
}
bool Extractor::extract(std::size_t , std::vector<Poco::UInt8>& )
{
throw NotImplementedException("std::vector extractor must be implemented.");
@@ -401,7 +399,6 @@ bool Extractor::extract(std::size_t , std::list<Poco::UInt64>& )
}
#ifndef POCO_LONG_IS_64_BIT
bool Extractor::extract(std::size_t , std::vector<long>& )
{
throw NotImplementedException("std::vector extractor must be implemented.");
@@ -418,7 +415,6 @@ bool Extractor::extract(std::size_t , std::list<long>& )
{
throw NotImplementedException("std::list extractor must be implemented.");
}
#endif
bool Extractor::extract(std::size_t , std::vector<bool>& )