diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-26 10:58:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-26 10:58:50 +0200 |
commit | 3d022058bc8b61c14c2d16e760ea1393d775c0d0 (patch) | |
tree | 81e7dd01fc15220b96c39c406df7bb5ad45627e0 /oracle/types/test.hxx | |
parent | d7752cdb86957f7dc0caffe6033e872443ad8153 (diff) |
Reimplement image copying for Oracle
Now we no longer "steal" descriptors (destructive copy). Instead, for
LOBs, we clone the locator using OCILobAssign(). For date-time types we
extract the data during copying. As a result of this change we no longer
need to track image changes and rebind the statements.
Diffstat (limited to 'oracle/types/test.hxx')
-rw-r--r-- | oracle/types/test.hxx | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index a3dac3f..ac903b8 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -275,25 +275,33 @@ struct big_int }; #pragma db object -struct blob +struct descriptor { - blob (): id_ (0) {} - - blob (unsigned int id, std::size_t n) - : id_ (id), value_ (n, 'b') - { - } + descriptor (unsigned int id = 0): id_ (id) {} #pragma db id unsigned int id_; #pragma db type ("BLOB") - std::vector<char> value_; + std::vector<char> blob; + + #pragma db type ("TIMESTAMP(6)") + date_time timestamp; + + #pragma db type ("INTERVAL DAY TO SECOND") + time_interval interval_ds; + + #pragma db type ("INTERVAL YEAR TO MONTH") + time_interval interval_ym; bool - operator== (const blob& y) const + operator== (const descriptor& y) const { - return id_ == y.id_ && value_ == y.value_; + return id_ == y.id_ && + blob == y.blob && + timestamp == y.timestamp && + interval_ds == y.interval_ds && + interval_ym == y.interval_ym; } }; |