mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-19 08:46:41 +01:00
MySQL: accept BLOBs type for strings
This commit is contained in:
parent
c43358e50b
commit
d09a728029
@ -148,9 +148,11 @@ bool Extractor::extract(std::size_t pos, std::string& val)
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
|
||||
return false;
|
||||
|
||||
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_STRING)
|
||||
//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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user