Skip to content

Commit

Permalink
Update unit tests of ODBC backend for complete integer type support
Browse files Browse the repository at this point in the history
  • Loading branch information
zann1x committed May 8, 2022
1 parent 78ca03b commit 9437df4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/odbc/test-odbc-access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ struct table_creator_one : public table_creator_base
: table_creator_base(sql)
{
sql << "create table soci_test(id integer, val integer, c char, "
"str varchar(20), sh integer, ul number, d float, "
"num76 numeric(7,6), "
"str varchar(20), sh integer, ll number, ul number, "
"d float, num76 numeric(7,6), "
"tm timestamp, i1 integer, i2 integer, i3 integer, "
"name varchar(20))";
}
Expand Down
9 changes: 7 additions & 2 deletions tests/odbc/test-odbc-db2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ struct table_creator_one : public table_creator_base
table_creator_one(soci::session & sql)
: table_creator_base(sql)
{
sql << "CREATE TABLE SOCI_TEST(ID INTEGER, VAL SMALLINT, C CHAR, STR VARCHAR(20), SH SMALLINT, UL NUMERIC(20), D DOUBLE, "
"NUM76 NUMERIC(7,6), "
sql << "CREATE TABLE SOCI_TEST(ID INTEGER, VAL SMALLINT, C CHAR, STR VARCHAR(20), SH SMALLINT, LL BIGINT, UL NUMERIC(20), "
"D DOUBLE, NUM76 NUMERIC(7,6), "
"TM TIMESTAMP(9), I1 INTEGER, I2 INTEGER, I3 INTEGER, NAME VARCHAR(20))";
}
};
Expand Down Expand Up @@ -89,6 +89,11 @@ class test_context : public test_context_base
return new table_creator_for_get_affected_rows(s);
}

bool has_uint64_support() const SOCI_OVERRIDE
{
return false;
}

std::string to_date_time(std::string const &datdt_string) const
{
return "\'" + datdt_string + "\'";
Expand Down
9 changes: 7 additions & 2 deletions tests/odbc/test-odbc-mssql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ struct table_creator_one : public table_creator_base
: table_creator_base(sql)
{
sql << "create table soci_test(id integer, val integer, c char, "
"str varchar(20), sh smallint, ul numeric(20), d float, "
"num76 numeric(7,6), "
"str varchar(20), sh smallint, ll bigint, ul numeric(20), "
"d float, num76 numeric(7,6), "
"tm datetime, i1 integer, i2 integer, i3 integer, "
"name varchar(20))";
}
Expand Down Expand Up @@ -210,6 +210,11 @@ class test_context : public test_context_base
return true;
}

bool has_uint64_support() const SOCI_OVERRIDE
{
return false;
}

std::string sql_length(std::string const& s) const SOCI_OVERRIDE
{
return "len(" + s + ")";
Expand Down
9 changes: 7 additions & 2 deletions tests/odbc/test-odbc-postgresql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ struct table_creator_one : public table_creator_base
: table_creator_base(sql)
{
sql << "create table soci_test(id integer, val integer, c char, "
"str varchar(20), sh int2, ul numeric(20), d float8, "
"num76 numeric(7,6), "
"str varchar(20), sh int2, ll bigint, ul numeric(20), "
"d float8, num76 numeric(7,6), "
"tm timestamp, i1 integer, i2 integer, i3 integer, "
"name varchar(20))";
}
Expand Down Expand Up @@ -212,6 +212,11 @@ class test_context : public test_context_base
return !m_verDriver.is_initialized() || m_verDriver < odbc_version(9, 3, 400);
}

bool has_uint64_support() const SOCI_OVERRIDE
{
return false;
}

std::string fix_crlf_if_necessary(std::string const& s) const SOCI_OVERRIDE
{
// Version 9.03.0300 (ancient, but still used on AppVeyor CI) is known
Expand Down

0 comments on commit 9437df4

Please sign in to comment.