mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
add test for #4108
This commit is contained in:
@@ -254,6 +254,26 @@ SQLiteTest::~SQLiteTest()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SQLiteTest::testBind()
|
||||||
|
{
|
||||||
|
int f1 = -1;
|
||||||
|
Session session(Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||||
|
session << "DROP TABLE IF EXISTS test", now;
|
||||||
|
session << "CREATE TABLE test (f1 INTEGER)", now;
|
||||||
|
|
||||||
|
Statement statement(session);
|
||||||
|
statement << "INSERT INTO test(f1) VALUES(?)";
|
||||||
|
statement.addBind(Poco::Data::Keywords::bind(1, "f1"));
|
||||||
|
statement.execute();
|
||||||
|
session << "SELECT f1 FROM test", into(f1), now;
|
||||||
|
assertTrue (f1 == 1);
|
||||||
|
statement.removeBind("f1");
|
||||||
|
statement.addBind(Poco::Data::Keywords::bind(2, "f1"));
|
||||||
|
statement.execute();
|
||||||
|
assertTrue (f1 == 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SQLiteTest::testBinding()
|
void SQLiteTest::testBinding()
|
||||||
{
|
{
|
||||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
SQLiteTest(const std::string& name);
|
SQLiteTest(const std::string& name);
|
||||||
~SQLiteTest();
|
~SQLiteTest();
|
||||||
|
|
||||||
|
void testBind();
|
||||||
void testBinding();
|
void testBinding();
|
||||||
void testZeroRows();
|
void testZeroRows();
|
||||||
void testSimpleAccess();
|
void testSimpleAccess();
|
||||||
|
|||||||
Reference in New Issue
Block a user