#include "pq-binarycolumn.h" #include "pq-selectbase.h" #include PQ::BinaryColumn::BinaryColumn(const PQ::SelectBase * s, unsigned int f) : PQ::Column(s, f) { } void PQ::BinaryColumn::apply(DB::HandleField & h) const { if (isNull()) { h.null(); return; } switch (oid) { case 18: //CHAROID: case 1043: //VARCHAROID: case 25: //TEXTOID: case 142: //XMLOID: h.string(value(), length()); break; case 16: //BOOLOID: h.boolean(valueAs()); break; case 21: //INT2OID: h.integer(be16toh(valueAs())); break; case 23: //INT4OID: h.integer(be32toh(valueAs())); break; case 20: //INT8OID: h.integer(be64toh(valueAs())); break; case 17: //BYTEAOID h.blob(DB::Blob(value(), length())); break; default: throw DB::ColumnTypeNotSupported(); } }