ClickHouse/dbms/src/Processors/Formats/Impl/MySQLOutputFormat.h
Ivan Lezhankin 967e00a8da It works!
if compiled with:

CC=clang CXX=clang++ cmake -Wno-dev . -Bbuild -GNinja -DCMAKE_AR:FILEPATH=x86_64-apple-darwin-ar -DCMAKE_RANLIB:FILEPATH=x86_64-apple-darwin-ranlib -DCMAKE_SYSTEM_NAME=Darwin -DSDK_PATH=MacOSX10.14.sdk -DLINKER_NAME=x86_64-apple-darwin-ld -DUSE_SNAPPY=OFF -DENABLE_SSL=OFF -DENABLE_PROTOBUF=OFF -DENABLE_PARQUET=OFF -DENABLE_READLINE=OFF -DENABLE_ICU=OFF -DENABLE_FASTOPS=OFF
2019-09-20 20:09:22 +03:00

49 lines
937 B
C++

#pragma once
#include "config_core.h"
#if USE_SSL
#include <Processors/Formats/IRowOutputFormat.h>
#include <Core/Block.h>
#include <Core/MySQLProtocol.h>
#include <Formats/FormatSettings.h>
namespace DB
{
class IColumn;
class IDataType;
class WriteBuffer;
class Context;
/** A stream for outputting data in a binary line-by-line format.
*/
class MySQLOutputFormat: public IOutputFormat
{
public:
MySQLOutputFormat(WriteBuffer & out_, const Block & header_, const Context & context_, const FormatSettings & settings_);
String getName() const override { return "MySQLOutputFormat"; }
void consume(Chunk) override;
void finalize() override;
void flush() override;
void doWritePrefix() override { initialize(); }
void initialize();
private:
bool initialized = false;
const Context & context;
MySQLProtocol::PacketSender packet_sender;
FormatSettings format_settings;
};
}
#endif