aboutsummaryrefslogtreecommitdiff
path: root/common/erase-query/driver.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-26 10:05:25 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-26 17:15:52 +0200
commit1f14eecfed1303d5d7bf5febcba29e06c2d19d9e (patch)
tree08e5cdfc1392df9519d9079b0abac0d3a6c3f7b8 /common/erase-query/driver.cxx
parent82c04419fe56ef491c40a02c316338bfc380787f (diff)
Quote schema object identifiers for Oracle where necessary
Oracle converts all alphabetical characters in unquoted schema object identifiers to uppercase. This behaviour cannot be disabled.
Diffstat (limited to 'common/erase-query/driver.cxx')
-rw-r--r--common/erase-query/driver.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx
index 40290ec..a80a252 100644
--- a/common/erase-query/driver.cxx
+++ b/common/erase-query/driver.cxx
@@ -13,6 +13,7 @@
#include <odb/database.hxx>
#include <odb/transaction.hxx>
+#include <common/config.hxx> // DATABASE_XXX
#include <common/common.hxx>
#include "test.hxx"
@@ -62,8 +63,13 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
+#ifndef DATABASE_ORACLE
assert (db->erase_query<object> (
"erase_query_object.id < 3") == 2);
+#else
+ assert (db->erase_query<object> (
+ "\"erase_query_object\".\"id\" < 3") == 2);
+#endif
db->erase_query<object> ();
t.commit ();
}
@@ -155,12 +161,21 @@ main (int argc, char* argv[])
t.commit ();
}
+#ifndef DATABASE_ORACLE
{
transaction t (db->begin ());
assert (db->execute ("SELECT * FROM erase_query_object_v "
"WHERE object_id = 1") == 0);
t.commit ();
}
+#else
+ {
+ transaction t (db->begin ());
+ assert (db->execute ("SELECT * FROM \"erase_query_object_v\" "
+ "WHERE \"object_id\" = 1") == 0);
+ t.commit ();
+ }
+#endif
}
catch (const odb::exception& e)
{