ClickHouse/libs/libmysqlxx/src/Row.cpp
Orivej Desh 5ec179377a DEVTOOLS-5170 Delete Y_IGNORE markers (#5533)
They have been superseded by a new include resolution configuration that lives
outside clickhouse source tree.
2019-06-05 14:52:39 +03:00

25 lines
463 B
C++

#if __has_include(<mariadb/mysql.h>)
#include <mariadb/mysql.h>
#else
#include <mysql/mysql.h>
#endif
#include <mysqlxx/Row.h>
namespace mysqlxx
{
Value Row::operator[] (const char * name) const
{
unsigned n = res->getNumFields();
MYSQL_FIELDS fields = res->getFields();
for (unsigned i = 0; i < n; ++i)
if (!strcmp(name, fields[i].name))
return operator[](i);
throw Exception(std::string("Unknown column ") + name);
}
}