Skip to content

Commit

Permalink
Merge pull request #74 from vnaydionov/master
Browse files Browse the repository at this point in the history
Fix Firebird tests: test_get_affected_rows()
  • Loading branch information
vnaydionov committed Feb 18, 2013
2 parents 5c83113 + 2f1ac40 commit 9b7ab2d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/backends/firebird/statement.cpp
Expand Up @@ -579,7 +579,7 @@ long long firebird_statement_backend::get_affected_rows()
// type, its value length in bytes and the value itself.
long long row_count = 0;

for ( char* p = sql_rec_buf; p < sql_rec_buf + length; )
for ( char* p = sql_rec_buf; !row_count && p < sql_rec_buf + length; )
{
switch (*p++)
{
Expand Down
19 changes: 16 additions & 3 deletions src/backends/firebird/test/test-firebird.cpp
Expand Up @@ -1230,16 +1230,24 @@ struct TableCreator3 : public tests::table_creator_base
TableCreator3(session & sql)
: tests::table_creator_base(sql)
{
// CommonTest uses lower-case column names,
// so we need to enforce such names here.
// That's why column names are enclosed in ""
sql << "create table soci_test(name varchar(100) not null, "
"phone varchar(15))";
sql.commit();
sql.begin();
}
};

struct TableCreator4 : public tests::table_creator_base
{
TableCreator4(session & sql)
: tests::table_creator_base(sql)
{
sql << "create table soci_test(val integer)";
sql.commit();
sql.begin();
}
};

class test_context : public tests::test_context_base
{
public:
Expand All @@ -1263,6 +1271,11 @@ class test_context : public tests::test_context_base
return new TableCreator3(s);
}

tests::table_creator_base* table_creator_4(session& s) const
{
return new TableCreator4(s);
}

std::string to_date_time(std::string const &datdt_string) const
{
return "'" + datdt_string + "'";
Expand Down

0 comments on commit 9b7ab2d

Please sign in to comment.