mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
add test for #4108
This commit is contained in:
parent
aabc8907b6
commit
b90316f949
@ -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()
|
||||
{
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
SQLiteTest(const std::string& name);
|
||||
~SQLiteTest();
|
||||
|
||||
void testBind();
|
||||
void testBinding();
|
||||
void testZeroRows();
|
||||
void testSimpleAccess();
|
||||
|
Loading…
x
Reference in New Issue
Block a user