summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-14 15:18:10 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-21 11:47:14 +0200
commite316e483104637ac23d842fe8ca583aa372d3dc1 (patch)
treebe23bcc0e8a1de2a6e0fc41f3256fcb182822bc3
parent3c6f03e0a686e7cf4d9cd1a92c495530798ac595 (diff)
Correct Oracle SQL type parser implementation
-rw-r--r--odb/relational/oracle/context.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/odb/relational/oracle/context.cxx b/odb/relational/oracle/context.cxx
index e9e83d1..c521114 100644
--- a/odb/relational/oracle/context.cxx
+++ b/odb/relational/oracle/context.cxx
@@ -399,7 +399,9 @@ namespace relational
// Some prefixes can also be type names if not followed
// by the actual type name.
//
- if (r.type == sql_type::invalid && !prefix.empty ())
+ if (r.type != sql_type::invalid)
+ t = l.next ();
+ else if (!prefix.empty ())
{
if (prefix == "CHAR" || prefix == "CHARACTER")
{
@@ -423,20 +425,20 @@ namespace relational
r.range = true;
r.range_value = 6;
}
- }
- if (r.type == sql_type::invalid)
- {
- cerr << m.file () << ":" << m.line () << ":" <<
- m.column () << ":";
+ if (r.type == sql_type::invalid)
+ {
+ cerr << m.file () << ":" << m.line () << ":" <<
+ m.column () << ":";
- if (tt == sql_token::t_identifier)
- cerr << " error: unknown Oracle type '" <<
- prefix + t.identifier () << "'" << endl;
- else
- cerr << " error: expected Oracle type name" << endl;
+ if (tt == sql_token::t_identifier)
+ cerr << " error: unknown Oracle type '" <<
+ prefix + t.identifier () << "'" << endl;
+ else
+ cerr << " error: expected Oracle type name" << endl;
- throw operation_failed ();
+ throw operation_failed ();
+ }
}
// Fall through.