Commit Graph

551 Commits

Author SHA1 Message Date
Mike Bayer 67878d13ed - Fixed an error in expression typing which caused an endless
loop for expressions with two NULL types.
2010-04-06 11:39:09 -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 efa88d4af9 branch merge 2010-04-03 11:00:19 -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 5c758932a5 - Restored some bind-labeling logic from 0.5 which ensures
that tables with column names that overlap another column
of the form "<tablename>_<columnname>" won't produce
errors if column._label is used as a bind name during
an UPDATE.  Test coverage which wasn't present in 0.5
has been added.  [ticket:1755]
2010-03-31 13:01:40 -04:00
Mike Bayer 5d0d680693 comment out test that relies on dictionary ordering for now 2010-03-27 18:15:05 -04:00
Mike Bayer 36047e9bb2 - Added with_hint() method to Query() construct. This calls
directly down to select().with_hint() and also accepts
entities as well as tables and aliases.  See with_hint() in the
SQL section below. [ticket:921]
- Added with_hint() method to select() construct.  Specify
a table/alias, hint text, and optional dialect name, and
"hints" will be rendered in the appropriate place in the
statement.  Works for Oracle, Sybase, MySQL.  [ticket:921]
2010-03-27 17:18:53 -04:00
Mike Bayer f62bc637a0 this test is too db specific and is covered by dialect tests 2010-03-27 10:51:03 -04:00
Mike Bayer 832d508816 one additional oracle fix 2010-03-26 11:15:25 -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 1321db6473 - Fixed bug introduced in 0.6beta2 where column labels would
render inside of column expressions already assigned a label.
[ticket:1747]
2010-03-23 20:41:40 -04:00
Mike Bayer 0a556d3220 - Fixed bug in Query whereby the usage of aliased() constructs
would fail if the underlying table (but not the actual alias)
were referenced inside the subquery generated by
q.from_self() or q.select_from().
2010-03-23 14:54:26 -04:00
Mike Bayer eb72838953 - pymssql now works again, expecting at least the 1.0 series. 2010-03-20 11:50:39 -04:00
Mike Bayer 0f55ef3bea rename test_select to test_compiler 2010-03-19 15:32:17 -04:00
Mike Bayer c6fbff56a3 - join() will now simulate a NATURAL JOIN by default. Meaning,
if the left side is a join, it will attempt to join the right
side to the rightmost side of the left first, and not raise
any exceptions about ambiguous join conditions if successful
even if there are further join targets across the rest of
the left.  [ticket:1714]
2010-03-19 15:30:48 -04:00
Mike Bayer 17b616236e nobody expects the insanely significant decimal 2010-03-19 16:35:31 +00:00
Mike Bayer 7de2b6923f - get firebird on board
- a lot of these drivers suck at decimals, not sure what to do
2010-03-19 12:30:22 -04:00
Mike Bayer e2807dcd36 make this test slightly easier, SQLite + win32 appears to not like it otherwise 2010-03-19 11:04:45 -05:00
Mike Bayer 32f8a11153 still poking at numerics 2010-03-19 11:55:59 -04:00
Mike Bayer 7a8f05d435 distinguish between small, large, and many significant digits. the irony
that oracle and sybase are the ones that have the most issues with decimal numbers.
2010-03-19 11:45:42 -04:00
Mike Bayer bb45ff1dbb - the string approach appears to be necessary for large numbers, however.
Don't know how to get large decimals through to Sybase.
2010-03-19 11:35:32 -04:00
Mike Bayer b2c2f58d98 some more tests. unfortunately i cant run them here since my osx freetds/pyodbc is hosed 2010-03-18 21:28:54 -04:00
Mike Bayer c8dfb3540a - normalize sybase version numbers
- sybase has 255 identifier length on 15, 30 earlier
2010-03-18 16:07:48 -04:00
Mike Bayer 6238032c8d - oracle needs a filter for this test
- oracle outparam test reveals usage of numeric proc with scale==None
2010-03-18 19:47:33 +00:00
Mike Bayer 9aa0868a41 clean up NumericTest to use a consistent one column at a time system 2010-03-18 15:34:09 -04:00
Brad Allen e9df4ff45a Merged from main tip. 2010-03-18 11:20:45 -06:00
Brad Allen b7f0b5b2c2 per zzzeek, for mssql+mxodbc, disabled test.sql.test_query.QueryTest.test_bind_in 2010-03-18 11:14:46 -06:00
Mike Bayer fc2f095c65 cx_oracle adjust 2010-03-18 16:10:29 +00:00
Mike Bayer 03965285a2 adjustment for pysybase 2010-03-18 16:08:39 +00:00
Mike Bayer 77fa087d15 turning the decimals to floats allows the E notation to work with sybase+pyodbc for small E notations 2010-03-18 12:05:20 -04:00
Mike Bayer 074cab9e7d - moved most Decimal bind/result handling into types.py, out of sqlite, mysql dialects.
- added an explicit test for [ticket:1216]
- some questions remain about MSSQL - would like to simplify/remove bind handling for numerics
2010-03-18 11:48:24 -04:00
Brad Allen 2282a4b8af Merge 2010-03-18 08:53:06 -06:00
Mike Bayer b6b4f60e74 some ms fixes 2010-03-17 22:33:08 -04:00
Brad Allen 87c50f2aac Because of changes to SQLAlchemy bind parameter placement, removed all mxodbc test disabling statements having this pattern: @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: 2010-03-17 16:27:39 -06:00
Brad Allen 75e7b1081c merged from main tip 2010-03-17 16:11:45 -06:00
Brad Allen e6a7f1ce0c Merged from main tip, and resolved conflicts in mxodbc dialect and connector. 2010-03-17 16:06:42 -06:00
Mike Bayer 95c0214356 working through syb capabilities 2010-03-17 17:29:35 -04:00
Mike Bayer 318f47dc80 - added pyodbc for sybase driver.
- generalized the "freetds" / "unicode statements" behavior of MS-SQL/pyodbc
into the base Pyodbc connector, as this seems to apply to Sybase as well.
- generalized the python-sybase "use autocommit for DDL" into the pyodbc
connector.  With pyodbc, the "autocommit" flag on connection is used,
as Pyodbc seems to have more database conversation than python-sybase that
can't otherwise be suppressed.
- Some platforms will now interpret certain literal values
as non-bind parameters, rendered literally into the SQL
statement.   This to support strict SQL-92 rules that are
enforced by some platforms including MS-SQL and Sybase.
In this model, bind parameters aren't allowed in the
columns clause of a SELECT, nor are certain ambiguous
expressions like "?=?".  When this mode is enabled, the base
compiler will render the binds as inline literals, but only across
strings and numeric values.  Other types such as dates
will raise an error, unless the dialect subclass defines
a literal rendering function for those.  The bind parameter
must have an embedded literal value already or an error
is raised (i.e. won't work with straight bindparam('x')).
Dialects can also expand upon the areas where binds are not
accepted, such as within argument lists of functions
(which don't work on MS-SQL when native SQL binding is used).
2010-03-17 15:15:44 -04:00
Brad Allen d6b5550f42 Disabling tests for mssql+mxodbc where mxODBC cursor.execute chokes on invalid placement of bind parameter "?" within the SQL statement. 2010-03-16 16:57:54 -06: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
Mike Bayer b3ba365eea fix failing test due to sybase paramstyle 2010-03-14 19:50:50 -04:00
Philip Jenvey 09dc52c03d tweak to take advantage of returning support in executemany 2010-03-12 19:01:59 -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 b4f1fbc708 think I came across a syntactical weirdism there 2010-03-11 22:38:15 -05:00
Mike Bayer e66ca9edd5 adding windows-appropriate levels of pain to unicode handling 2010-03-11 22:10:25 -05:00
Mike Bayer 7c8942d4eb Added a non-freetds specific exclusion for pyodbc 2010-03-11 21:23:25 -05:00
Mike Bayer 30327525de this resolves the returning failures from #1733 2010-03-11 21:36:03 +00:00
Mike Bayer b763015642 re-enable these tests 2010-03-11 21:34:13 +00:00
Mike Bayer ec0fafc7b0 added better typing for integer expressions, since integer is implementing _DateAffinity 2010-03-11 16:18:37 -05:00