diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-22 15:28:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-22 15:28:38 +0200 |
commit | fd706a1f86e48ae9b22d3bee017ff67220c0505e (patch) | |
tree | 67f33c1ef85775fd8f5cb102bd7e3e7f91e468dc | |
parent | a3e92641c7792573ff3075b3b3265377ec55a7a5 (diff) |
Fix bug in Oracle DECIMAL/NUMERIC type aliases parsing
-rw-r--r-- | odb/relational/oracle/context.cxx | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/odb/relational/oracle/context.cxx b/odb/relational/oracle/context.cxx index d3422c2..4eff3ed 100644 --- a/odb/relational/oracle/context.cxx +++ b/odb/relational/oracle/context.cxx @@ -220,35 +220,26 @@ namespace relational // // Numeric types. // - if ((id == "NUMBER" || id == "DEC" || id == "DECIMAL") && - prefix.empty ()) + if ((id == "NUMBER") && prefix.empty ()) { - // DEC and DECIMAL are equivalent to NUMBER. + // If NUMBER has no precision/scale, then it is a floating- + // point number. We indicate this by having no range. // r.type = sql_type::NUMBER; s = parse_range; - - // If NUMBER has not precision/scale, then it is a floating- - // point number. We indicate this by having no range. } - else if ((id == "DEC" || id == "DECIMAL" || id == "NUMERIC" || - id == "INT" || id == "INTEGER" || id == "SMALLINT") + else if ((id == "DEC" || id == "DECIMAL" || id == "NUMERIC") && prefix.empty ()) { - // DEC, DECIMAL, and NUMERIC are equivalent. They are - // equivalent to NUMBER in all ways except that they may not - // represent a floating point number. The scale defaults to - // zero. + // DEC, DECIMAL, and NUMERIC are equivalent to NUMBER in + // all ways except that they may not represent a floating + // point number. The scale defaults to zero. // r.type = sql_type::NUMBER; - r.range = true; - r.range = 38; - s = parse_range; } - else if ((id == "INT" || - id == "INTEGER" || - id == "SMALLINT") && prefix.empty ()) + else if ((id == "INT" || id == "INTEGER" || id == "SMALLINT") + && prefix.empty ()) { // INT, INTEGER, and SMALLINT map to NUMBER(38). They may not // have range or scale explicitly specified. |