From e316e483104637ac23d842fe8ca583aa372d3dc1 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 14 Oct 2011 15:18:10 +0200 Subject: Correct Oracle SQL type parser implementation --- odb/relational/oracle/context.cxx | 26 ++++++++++++++------------ 1 file 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. -- cgit v1.1