aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oracle/types/driver.cxx25
-rw-r--r--oracle/types/makefile3
2 files changed, 27 insertions, 1 deletions
diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx
index 371388c..994885f 100644
--- a/oracle/types/driver.cxx
+++ b/oracle/types/driver.cxx
@@ -168,6 +168,31 @@ main (int argc, char* argv[])
assert (bui2 == *buil2);
assert (bui3 == *buil3);
}
+
+ // Test descriptor management in TIMESTAMP and INTERVAL images.
+ //
+ {
+ typedef odb::query<object> query;
+ typedef odb::result<object> result;
+
+ query q (query::timestamp == o.timestamp_ &&
+ query::interval_ym == o.interval_ym_ &&
+ query::interval_ds == o.interval_ds_);
+
+ transaction t (db->begin ());
+
+ {
+ result r (db->query<object> (q));
+ assert (size (r) == 1);
+ }
+
+ {
+ result r (db->query<object> (q));
+ assert (size (r) == 1);
+ }
+
+ t.commit ();
+ }
}
catch (const odb::exception& e)
{
diff --git a/oracle/types/makefile b/oracle/types/makefile
index 7f01dd6..69b3b66 100644
--- a/oracle/types/makefile
+++ b/oracle/types/makefile
@@ -36,7 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): $(odb)
$(gen): odb := $(odb)
$(gen) $(dist): export odb_options += --database oracle --generate-schema \
---table-prefix oracle_types_ --hxx-prologue '\#include "traits.hxx"'
+--generate-query --hxx-prologue '\#include "traits.hxx"' \
+--table-prefix oracle_types_
$(gen): cpp_options := -I$(src_base)
$(gen): $(common.l.cpp-options)