From 1f14eecfed1303d5d7bf5febcba29e06c2d19d9e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 10:05:25 +0200 Subject: 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. --- common/erase-query/driver.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'common/erase-query') 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 #include +#include // DATABASE_XXX #include #include "test.hxx" @@ -62,8 +63,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); +#ifndef DATABASE_ORACLE assert (db->erase_query ( "erase_query_object.id < 3") == 2); +#else + assert (db->erase_query ( + "\"erase_query_object\".\"id\" < 3") == 2); +#endif db->erase_query (); 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) { -- cgit v1.1