summaryrefslogtreecommitdiff
path: root/libodbcpp/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/unittests')
-rw-r--r--libodbcpp/unittests/testodbc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libodbcpp/unittests/testodbc.cpp b/libodbcpp/unittests/testodbc.cpp
index bb6fd97..9a810c7 100644
--- a/libodbcpp/unittests/testodbc.cpp
+++ b/libodbcpp/unittests/testodbc.cpp
@@ -4,6 +4,7 @@
#include <definedDirs.h>
#include <modifycommand.h>
#include <selectcommand.h>
+#include <selectcommandUtil.impl.h>
#include <column.h>
#include <error.h>
#include <odbc-mock.h>
@@ -90,5 +91,19 @@ BOOST_AUTO_TEST_CASE( bindAndSelectOther )
BOOST_REQUIRE_EQUAL(1, rows);
}
+BOOST_AUTO_TEST_CASE( multibyte )
+{
+ auto ro = DB::MockDatabase::openConnectionTo("odbcmock");
+
+ auto select = ro->select("SELECT LPAD('', n, '£'), n FROM GENERATE_SERIES(1, 50000, 200) n");
+ select->execute();
+ int rows = 0;
+ for (const auto [s, n] : select->as<std::string, int64_t>()) {
+ BOOST_CHECK_EQUAL(s.length(), n * 2);
+ rows += 1;
+ }
+ BOOST_REQUIRE_EQUAL(250, rows);
+}
+
BOOST_AUTO_TEST_SUITE_END();