mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Using mysqlxx library.
This commit is contained in:
parent
8afc9ac8bb
commit
740df01db3
@ -13,11 +13,13 @@ namespace DB
|
||||
/** Записать UInt64 в формате переменной длины (base128) */
|
||||
void writeVarUInt(UInt64 x, std::ostream & ostr);
|
||||
void writeVarUInt(UInt64 x, WriteBuffer & ostr);
|
||||
char * writeVarUInt(UInt64 x, char * ostr);
|
||||
|
||||
|
||||
/** Прочитать UInt64, записанный в формате переменной длины (base128) */
|
||||
void readVarUInt(UInt64 & x, std::istream & istr);
|
||||
void readVarUInt(UInt64 & x, ReadBuffer & istr);
|
||||
const char * readVarUInt(UInt64 & x, const char * istr);
|
||||
|
||||
|
||||
/** Получить длину UInt64 в формате VarUInt */
|
||||
|
@ -129,6 +129,18 @@ int main(int argc, char ** argv)
|
||||
|
||||
std::cerr << connection.query("SELECT * FROM tmp").store().size() << std::endl;
|
||||
}
|
||||
|
||||
{
|
||||
/// Транзакции
|
||||
mysqlxx::Connection connection2("test", "127.0.0.1", "root", "qwerty", 3306);
|
||||
connection2.query("DROP TABLE IF EXISTS tmp").execute();
|
||||
connection2.query("CREATE TABLE tmp (x INT, PRIMARY KEY (x)) ENGINE = InnoDB").execute();
|
||||
|
||||
mysqlxx::Transaction trans(connection2);
|
||||
connection2.query("INSERT INTO tmp VALUES (1)").execute();
|
||||
std::cerr << connection2.query("SELECT * FROM tmp").store().size() << std::endl;
|
||||
}
|
||||
std::cerr << connection.query("SELECT * FROM tmp").store().size() << std::endl;
|
||||
}
|
||||
catch (const mysqlxx::Exception & e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user