mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
46 lines
953 B
C++
46 lines
953 B
C++
#include <string>
|
|
|
|
#include <iostream>
|
|
#include <fstream>
|
|
|
|
#include <Core/Types.h>
|
|
#include <IO/WriteHelpers.h>
|
|
#include <IO/WriteBufferFromOStream.h>
|
|
|
|
|
|
int main(int, char **)
|
|
{
|
|
try
|
|
{
|
|
DB::Int64 a = -123456;
|
|
DB::Float64 b = 123.456;
|
|
DB::String c = "вася пе\tтя";
|
|
DB::String d = "'xyz\\";
|
|
|
|
std::ofstream s("test");
|
|
DB::WriteBufferFromOStream out(s);
|
|
|
|
for (int i = 0; i < 1000000; ++i)
|
|
{
|
|
DB::writeIntText(a, out);
|
|
DB::writeChar(' ', out);
|
|
|
|
DB::writeFloatText(b, out);
|
|
DB::writeChar(' ', out);
|
|
|
|
DB::writeEscapedString(c, out);
|
|
DB::writeChar('\t', out);
|
|
|
|
DB::writeQuotedString(d, out);
|
|
DB::writeChar('\n', out);
|
|
}
|
|
}
|
|
catch (const DB::Exception & e)
|
|
{
|
|
std::cerr << e.what() << ", " << e.displayText() << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|