Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
23f4950a
Commit
23f4950a
authored
5 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Added unit-test cta_rdbms_StmtTest.insert_with_bindUint64
parent
53ebe033
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rdbms/StmtTest.cpp
+39
-1
39 additions, 1 deletion
rdbms/StmtTest.cpp
with
39 additions
and
1 deletion
rdbms/StmtTest.cpp
+
39
−
1
View file @
23f4950a
...
...
@@ -46,7 +46,7 @@ void cta_rdbms_StmtTest::SetUp() {
// Do nothing
}
m_conn
.
executeNonQuery
(
"CREATE TABLE STMT_TEST(DOUBLE_COL FLOAT)"
);
m_conn
.
executeNonQuery
(
"CREATE TABLE STMT_TEST(DOUBLE_COL FLOAT
, UINT64_COL NUMERIC(20, 0)
)"
);
}
//------------------------------------------------------------------------------
...
...
@@ -100,4 +100,42 @@ TEST_P(cta_rdbms_StmtTest, insert_with_bindDouble) {
}
}
TEST_P
(
cta_rdbms_StmtTest
,
insert_with_bindUint64
)
{
using
namespace
cta
::
rdbms
;
const
uint64_t
insertValue
=
1234
;
// Insert a row into the test table
{
const
char
*
const
sql
=
"INSERT INTO STMT_TEST("
"UINT64_COL) "
"VALUES("
":UINT64_COL)"
;
auto
stmt
=
m_conn
.
createStmt
(
sql
);
stmt
.
bindDouble
(
":UINT64_COL"
,
insertValue
);
stmt
.
executeNonQuery
();
}
// Select the row back from the table
{
const
char
*
const
sql
=
"SELECT "
"UINT64_COL AS UINT64_COL "
"FROM "
"STMT_TEST"
;
auto
stmt
=
m_conn
.
createStmt
(
sql
);
auto
rset
=
stmt
.
executeQuery
();
ASSERT_TRUE
(
rset
.
next
());
const
auto
selectValue
=
rset
.
columnOptionalDouble
(
"UINT64_COL"
);
ASSERT_TRUE
((
bool
)
selectValue
);
ASSERT_EQ
(
insertValue
,
selectValue
.
value
());
ASSERT_FALSE
(
rset
.
next
());
}
}
}
// namespace unitTests
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment