Commit Graph

40 Commits

Author SHA1 Message Date
Mike Bayer 10db67be5b - More tweaks to cx_oracle Decimal handling.
"Ambiguous" numerics with no decimal place
are coerced to int at the connection handler
level.  The advantage here is that ints
come back as ints without SQLA type
objects being involved and without needless
conversion to Decimal first.

Unfortunately, some exotic subquery cases
can even see different types between
individual result rows, so the Numeric
handler, when instructed to return Decimal,
can't take full advantage of "native decimal"
mode and must run isinstance() on every value
to check if its Decimal already. Reopen of
[ticket:1840]
2010-07-14 14:50:45 -04:00
Mike Bayer e430aa915f test/dialect 2010-07-11 14:28:21 -04:00
Mike Bayer 8548ca8cc5 - add typing/operator converts to Float/Numeric to get Oracle tests going again,
as we have an unusually high level of dependence on SQLA typing now
- force oracle seqs to return integers
2010-07-02 13:55:24 -04:00
Mike Bayer 25db56bc0c - Oracle's "native decimal" metadata begins to return
ambiguous typing information about numerics
    when columns are embedded in subqueries as well
    as when ROWNUM is consulted with subqueries, as we
    do for limit/offset.  We've added these ambiguous
    conditions to the cx_oracle "convert to Decimal()"
    handler, so that we receive numerics as Decimal
    in more cases instead of as floats.  These are
    then converted, if requested, into Integer
    or Float, or otherwise kept as the lossless
    Decimal [ticket:1840].
2010-07-01 16:57:02 -04:00
Mike Bayer 5095369ce8 fix oracle char length test for newer descriptors 2010-06-27 13:05:05 -04:00
Mike Bayer 6457901f96 - Fixed ora-8 compatibility flags such that they
don't cache a stale value from before the first
database connection actually occurs. [ticket:1819]
2010-06-19 13:39:32 -04:00
Mike Bayer b086f9a815 - Re-established support for Oracle 8 with cx_oracle,
including that use_ansi is set to False automatically,
NVARCHAR2 and NCLOB are not rendered for Unicode,
"native unicode" check doesn't fail, cx_oracle
"native unicode" mode is disabled, VARCHAR() is emitted
with bytes count instead of char count. [ticket:1808]
2010-05-27 13:02:17 -04:00
Mike Bayer 40c7db67b4 - FOR UPDATE is emitted in the syntactically correct position
when limit/offset is used, i.e. the ROWNUM subquery.
However, Oracle can't really handle FOR UPDATE with ORDER BY
or with subqueries, so its still not very usable, but at
least SQLA gets the SQL past the Oracle parser.
[ticket:1815]
2010-05-27 11:50:16 -04:00
Mike Bayer 9d34c64095 - Fixed use_ansi=False mode, which was producing broken
WHERE clauses in pretty much all cases.  [ticket:1790]
2010-05-03 19:24:52 -04:00
Mike Bayer eefdbd3757 - Now using cx_oracle output converters so that the
DBAPI returns natively the kinds of values we prefer:
- NUMBER values with positive precision + scale convert
to cx_oracle.STRING and then to Decimal.   This
allows perfect precision for the Numeric type when
using cx_oracle.  [ticket:1759]
- STRING/FIXED_CHAR now convert to unicode natively.
SQLAlchemy's String types then don't need to
apply any kind of conversions.
2010-04-03 15:33:55 -04:00
Mike Bayer f432bc8fe1 - the Numeric type raises an *enormous* warning when expected
to convert floats to Decimal from a DBAPI that returns floats.
This includes SQLite, Oracle, Sybase, MS-SQL.
[ticket:1759]
2010-04-03 10:58:13 -04:00
Mike Bayer 6acc9e6d9e - The Oracle dialect will issue VARCHAR type definitions
using character counts, i.e. VARCHAR2(50 CHAR), so that
the column is sized in terms of characters and not bytes.
Column reflection of character types will also use
ALL_TAB_COLUMNS.CHAR_LENGTH instead of
ALL_TAB_COLUMNS.DATA_LENGTH.  Both of these behaviors take
effect when the server version is 9 or higher - for
version 8, the old behaviors are used.  [ticket:1744]
2010-03-25 22:26:11 +00:00
Mike Bayer 7cf74e9cca oracle cleanup 2010-03-19 22:29:08 -04:00
Mike Bayer cdda68aea3 - Added support for rendering and reflecting
TIMESTAMP WITH TIME ZONE, i.e. TIMESTAMP(timezone=True).
[ticket:651]

- Oracle INTERVAL type can now be reflected.
2010-03-19 18:10:53 -04:00
Mike Bayer 811ece1397 - The except_() method now renders as MINUS on Oracle,
which is more or less equivalent on that platform.
[ticket:1712]
2010-03-16 22:38:18 +00:00
Philip Jenvey 1e7fcd8798 adjust per a couple zxjdbc failures 2010-03-13 10:29:09 -08:00
Philip Jenvey 7ea254ea7a disable interval tests on oracle+zxjdbc for now, and also test_fk_nonpassive 2010-03-12 17:50:33 -08:00
Mike Bayer 1b16954864 - introduce an optimizing type _NativeUnicodeMixin to oracle plus supporting
changes to Enum/SchemaType to re-support adaptation of string types.
This approach can be adapted by "conditional" unicode returning dialects
(i.e. pyodbc and possibly mxodbc) to remove the overhead
of isinstance(value, unicode) calls when the dialect returned type is
of dbapi.UNICODE, dbapi.NVARCHAR, etc.
2010-03-12 18:30:38 +00:00
Mike Bayer ea4916001d - Oracle 'DATE' now does not perform any result processing,
as the DATE type in Oracle stores full date+time objects,
that's what you'll get.  Note that the generic types.Date
type *will* still call value.date() on incoming values,
however.  When reflecting a table, the reflected type
will be 'DATE'.
2010-03-11 10:27:18 -05:00
Mike Bayer 6b82c6e89b - use_ansi=False won't leak into the FROM/WHERE clause of
a statement that's selecting from a subquery that also
uses JOIN/OUTERJOIN.
2010-01-30 19:00:40 +00:00
Philip Jenvey cdfe09794a Binary -> LargeBinary 2010-01-26 06:15:20 +00:00
Mike Bayer 9680e6483f - added native INTERVAL type to the dialect. This supports
only the DAY TO SECOND interval type so far due to lack
  of support in cx_oracle for YEAR TO MONTH. [ticket:1467]
- The Interval type includes a "native" flag which controls
  if native INTERVAL types (postgresql + oracle) are selected
  if available, or not.  "day_precision" and "second_precision"
  arguments are also added which propagate as appropriately
  to these native types. Related to [ticket:1467].
- DefaultDialect.type_descriptor moves back to being per-dialect.
  TypeEngine/TypeDecorator key type impls to the dialect class
  + server_version_info so that the colspecs dict can be modified
  per-dialect based on server version.
- Fixed TypeDecorator's incorrect usage of _impl_dict
2010-01-18 03:00:05 +00:00
Mike Bayer 8fa55917ac - add a unit test for r6089 / [ticket:1438] 2010-01-17 21:49:31 +00:00
Mike Bayer 2b1937a31e - reorganized and re-documented Oracle schema tests to assume
test user has DBA privs, and all objects can be created /dropped.
- added ORDER BY to oracle column listing
- Oracle all_tables always limits to current user if schema not given.
- views reflect - added documentation + a unit test for this.
- Table(autoload) with no bind produces an error message specific to
the fact that autoload_with should be the first option to try.
2010-01-17 20:32:45 +00:00
Mike Bayer 67481f534f only on oracle 2009-12-29 02:45:32 +00:00
Mike Bayer bc5ad4e8af merged r6570 from 0.5 branch, dont reflect IOT tables [ticket:1637] 2009-12-26 22:41:44 +00:00
Mike Bayer 4ca12d76bd remove unneeded _OracleDateTime/_OracleTimestamp cx_oracle types, streamline _OracleDate, [ticket:1600] 2009-12-06 01:59:14 +00:00
Mike Bayer 447dc44e1f start relying on new unicode detection fully - remove isinstance() from the unicode result processing. 2009-11-15 19:46:54 +00:00
Mike Bayer 516dd178bf allow setattr() access to _CursorFairy directly, thereby removing the need for dialects to guess whether they have a wrapped cursor or not, fixes #1609, regression from r6471 2009-11-06 15:51:06 +00:00
Mike Bayer e2ca4ebe58 omit this test for non-oracle 2009-11-02 03:07:13 +00:00
Mike Bayer fb6be4d359 - filter out SYS_NC\d+$ columns [ticket:1513]
- remove explicit INNER JOIN from index query to support oracle 8
2009-11-01 21:53:00 +00:00
Mike Bayer 5119ce78b5 - The psycopg2 dialect now uses psycopg2's "unicode extension"
on all new connections, which allows all String/Text/etc.
types to skip the need to post-process bytestrings into
unicode (an expensive step due to its volume).  Other
dialects which return unicode natively (pg8000, zxjdbc)
also skip unicode post-processing.

- String/Text/Unicode types now skip the unicode() check
on each result column value if the dialect has
detected the DBAPI as returning Python unicode objects
natively.  This check is issued on first connect
using "SELECT CAST 'some text' AS VARCHAR(10)" or
equivalent, then checking if the returned object
is a Python unicode.   This allows vast performance
increases for native-unicode DBAPIs, including
pysqlite/sqlite3, psycopg2, and pg8000.
2009-10-26 00:32:39 +00:00
Mike Bayer 680f87c9ce - usage of the CHAR type results in cx_oracle's
FIXED_CHAR dbapi type being bound to statements.
2009-10-03 19:58:19 +00:00
Philip Jenvey 4f87ca83ec update per new Binary str handling 2009-09-11 22:51:25 +00:00
Mike Bayer d564baf593 - the Oracle dialect now features NUMBER which intends
to act justlike Oracle's NUMBER type.  It is the primary
numeric type returned by table reflection and attempts
to return Decimal()/float/int based on the precision/scale
parameters.  [ticket:885]
2009-08-09 23:46:06 +00:00
Philip Jenvey a53d4e2ab4 o oracle+zxjdbc type handling additions
o avoid returning tests on oracle+zxjdbc for now
2009-08-09 00:56:52 +00:00
Mike Bayer a7499ddfc0 fix up oracle tests, returning is on by default 2009-08-08 16:49:28 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer e58b66838d backported 0.6 r6084 fix for oracle alias names, [ticket:1309] 2009-07-31 23:10:46 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00