Commit Graph

70 Commits

Author SHA1 Message Date
Mike Bayer b1a01a6256 - replace mssql_ordering with generalized #695 solution
- documentation for mssql index options plus changelog and fixes
2013-01-20 12:43:39 -05:00
Derek Harland f5a5a6bf43 Add mssql_include option for mssql dialect 2013-01-14 17:03:38 +13:00
Derek Harland 38f7650072 Add mssql_ordering option for mssql dialect 2013-01-14 17:02:20 +13:00
Derek Harland 7198abb13e Add mssql_clustered option for mssql dialect 2013-01-14 17:00:37 +13:00
Mike Bayer 46a9209cde Added a py3K conditional around unnecessary .decode()
call in mssql information schema, fixes reflection
in Py3K. Also in 0.7.10. [ticket:2638]
2013-01-12 19:51:13 -05:00
Mike Bayer 56b1f4c884 - changelog for pullreq 32
- Fixed a regression whereby the "collation" parameter
of the character types CHAR, NCHAR, etc. stopped working,
as "collation" is now supported by the base string types.
The TEXT, NCHAR, CHAR, VARCHAR types within the
MSSQL dialect are now synonyms for the base types.
- move out the type rendering tests into DB-agnostic tests
and remove some of the old "create" statements.  tests here
are still very disorganized.
2013-01-12 12:14:15 -05:00
Derek Harland 72b1f475af Add several MSSQL dialect tests for sequence declarations 2012-12-04 14:49:03 +13:00
Mike Bayer e35a6b91d6 - [bug] Fixed compiler bug whereby using a correlated
subquery within an ORDER BY would fail to render correctly
    if the stament also used LIMIT/OFFSET, due to mis-rendering
    within the ROW_NUMBER() OVER clause.  Fix courtesy
    sayap [ticket:2538]
2012-09-30 16:57:23 -04:00
Mike Bayer be40b51cb0 getting everything to pass again 2012-09-27 16:33:54 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer 62b2955c7a test fixes 2012-09-22 13:37:39 -04:00
Mike Bayer 48f5c2e4f7 - further mxodbc tweaks affecting other test suites 2012-09-02 16:17:10 -04:00
Mike Bayer 8340361bfa - [bug] Fixed compiler bug whereby a given
select() would be modified if it had an "offset"
attribute, causing the construct to not compile
correctly a second time.  [ticket:2545]
2012-08-12 21:07:24 -04:00
Mike Bayer 7a81ecc82c - adjustments for py3.3 unit tests, [ticket:2542] 2012-08-11 21:46:48 -04:00
Mike Bayer c94756cce8 - [feature] SQL Server dialect can be given
database-qualified schema names,
i.e. "schema='mydatabase.dbo'"; reflection
operations will detect this, split the schema
among the "." to get the owner separately,
and emit a "USE mydatabase" statement before
reflecting targets within the "dbo" owner;
the existing database returned from
DB_NAME() is then restored.
2012-08-07 16:51:14 -04:00
Mike Bayer 18ab1b8c46 - more import cleanup for MSSQL 2012-08-07 16:49:02 -04:00
Mike Bayer 27913554a8 trailing whitespace bonanza 2012-07-28 15:50:05 -04:00
Mike Bayer 5c5634c04f - [bug] removed legacy behavior whereby
a column comparison to a scalar SELECT via
== would coerce to an IN with the SQL server
dialect.  This is implicit
behavior which fails in other scenarios
so is removed.  Code which relies on this
needs to be modified to use column.in_(select)
explicitly.  [ticket:2277]
2012-04-24 11:16:03 -04:00
Mike Bayer 541e59c3d7 - [bug] UPDATE..FROM syntax with SQL Server
requires that the updated table be present
in the FROM clause when an alias of that
table is also present in the FROM clause.
The updated table is now always present
in the FROM, when FROM is present
in the first place.  Courtesy sayap.
[ticket:2468]
2012-04-18 19:52:58 -04:00
Mike Bayer 4cb74452fe - [bug] Repaired the use_scope_identity
create_engine() flag when using the pyodbc
    dialect.  Previously this flag would be
    ignored if set to False.  When set to False,
    you'll get "SELECT @@identity" after each
    INSERT to get at the last inserted ID,
    for those tables which have "implicit_returning"
    set to False.
2012-04-05 14:31:28 -04:00
Mike Bayer 4d2c1e2f17 - [feature] Added support for MSSQL INSERT,
UPDATE, and DELETE table hints, using
new with_hint() method on UpdateBase.
[ticket:2430]
2012-03-13 14:00:05 -07:00
Mike Bayer 21870c7503 - [bug] Adjusted the regexp used in the
mssql.TIME type to ensure only six digits
    are received for the "microseconds" portion
    of the value, which is expected by
    Python's datetime.time().  Note that
    support for sending microseconds doesn't
    seem to be possible yet with pyodbc
    at least.  [ticket:2340]
2012-01-22 19:17:21 -05:00
Mike Bayer 2fca3c8ee8 - [bug] repaired the with_hint() feature which
wasn't implemented correctly on MSSQL -
usually used for the "WITH (NOLOCK)" hint
(which you shouldn't be using anyway !
use snapshot isolation instead :) )
[ticket:2336]
2011-12-03 20:04:55 -05:00
Mike Bayer c52e31b1e0 - The behavior of =/!= when comparing a scalar select
to a value will no longer produce IN/NOT IN as of 0.8;
    this behavior is a little too heavy handed (use in_() if
    you want to emit IN) and now emits a deprecation warning.
    To get the 0.8 behavior immediately and remove the warning,
    a compiler recipe is given at
    http://www.sqlalchemy.org/docs/07/dialects/mssql.html#scalar-select-comparisons
    to override the behavior of visit_binary().
    [ticket:2277]
2011-09-23 21:56:10 -04:00
Mike Bayer 5751eb17f1 - Query will convert an OFFSET of zero when
slicing into None, so that needless OFFSET
clauses are not invoked.
- mssql: "0" is accepted as an argument for limit() which
will produce "TOP 0". [ticket:2222]
- add tests to default compiler test for LIMIT/OFFSET generation
2011-08-06 15:03:33 -04:00
Mike Bayer 772ae63bdb add test for [ticket:2159] 2011-06-05 12:32:04 -04:00
Mike Bayer c7713a6f0a - Fixed bug in MSSQL dialect whereby the aliasing
applied to a schema-qualified table would leak
    into enclosing select statements [ticket:2169].
    Also in 0.6.8.
2011-05-19 12:00:47 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer ebd0fdad73 - convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
2011-03-26 21:40:05 -04:00
Mike Bayer 5d385768e6 whoops, only on SQL server 2011-03-18 12:30:06 -04:00
Mike Bayer 798339430a - Rewrote the query used to get the definition of a view,
typically when using the Inspector interface, to
use sys.sql_modules instead of the information schema,
thereby allowing views definitions longer than 4000
characters to be fully returned.  [ticket:2071]
2011-03-16 14:06:33 -04:00
Mike Bayer bc52cae455 - mssql VARBINARY emits 'max' for length when no length specified, as is
the case already for VARCHAR, NVARCHAR [ticket:1833]
2011-02-10 15:22:07 -05:00
Mike Bayer 67e0f356b2 - A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects
  as well as the "sqlite_autoincrement" flag will honor
  the underlying database type as being Integer-based.
 [ticket:2005]

- Result-row processors are applied to pre-executed SQL
  defaults, as well as cursor.lastrowid, when determining
  the contents of result.inserted_primary_key.
  [ticket:2006]

- Bind parameters present in the "columns clause" of a select
  are now auto-labeled like other "anonymous" clauses,
  which among other things allows their "type" to be meaningful
  when the row is fetched, as in result row processors.

- TypeDecorator is present in the "sqlalchemy" import space.
2011-01-11 15:22:46 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 54085a0e6a - MSSQL - the String/Unicode types, and their counterparts VARCHAR/
NVARCHAR, emit "max" as the length when no length is
specified.   This makes it more compatible with Postgresql's
VARCHAR type which is similarly unbounded when no length
specified.
2010-12-16 17:52:43 -05:00
Mike Bayer c691b4cbdf - support for cdecimal
- add --with-cdecimal flag to tests, monkeypatches cdecimal in
- fix mssql/pyodbc.py to not use private '_int' accessor in decimal conversion
routines
- pyodbc version 2.1.8 is needed for cdecimal in any case as
previous versions also called '_int', 2.1.8 adds the same string
logic as our own dialect, so that logic is skipped for modern
pyodbc version
- make the imports for "Decimal" consistent across the whole lib.  not sure
yet how we should be importing "Decimal" or what the best way forward
is that would allow a clean user-invoked swap of cdecimal; for now,
added docs suggesting a global monkeypatch - the two decimal libs
are not compatible with each other so any chance of mixing produces
serious issues.  adding adapters to DBAPIs tedious and adds in-python
overhead.  suggestions welcome on how we should be doing
Decimal/cdecimal.
2010-12-11 17:44:46 -05:00
Mike Bayer 35bfda533e - repair MS-SQL handling of LIMIT/OFFSET as binds, add bindparam() to the compile stream
so they function correctly
2010-11-29 17:28:36 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer a29f130be7 - mssql+pymssql dialect now honors the "port" portion
of the URL instead of discarding it.  [ticket:1952]
- testing.only_on() accepts db specs optionally as a list
2010-10-24 12:00:58 -04:00
Mike Bayer 9c0d6c0a23 - Rewrote the reflection of indexes to use sys.
catalogs, so that column names of any configuration
(spaces, embedded commas, etc.) can be reflected.
Note that reflection of indexes requires SQL
Server 2005 or greater.  [ticket:1770]
2010-10-23 18:09:36 -04:00
Mike Bayer db318240d1 - Fixed bug where aliasing of tables with "schema" would
fail to compile properly.  [ticket:1943]
2010-10-20 16:15:54 -04:00
Mike Bayer a714db53b3 - Fixed MSSQL reflection bug which did not properly handle
reflection of unknown types.  [ticket:1946]
2010-10-16 12:15:40 -04:00
Mike Bayer e430aa915f test/dialect 2010-07-11 14:28:21 -04:00
Mike Bayer 64d92c836c - If server_version_info is outside the usual
range of (8, ), (9, ), (10, ), a warning is emitted
which suggests checking that the FreeTDS version
configuration is using 7.0 or 8.0, not 4.2.
[ticket:1825]
2010-07-02 12:57:15 -04:00
Mike Bayer d56d420e80 mssql+mxodbc should use executedirect for all selects and execute for insert/update/delete. To support this, an is_crud property has been added to the DefaultExecutionContext. The behavior is forcable either way per execution using execution_options(native_odbc_parameters=True|False). Some tests have been added to demonstrate usage. (patch by zzzeek committed by bradallen) 2010-03-26 14:47:53 -06:00
Mike Bayer 268c64a6aa try < 0 2010-03-19 21:42:35 -04:00
Mike Bayer 5cd6539191 just mark this test as crashing for now 2010-03-19 21:39:36 -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
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 e6a7f1ce0c Merged from main tip, and resolved conflicts in mxodbc dialect and connector. 2010-03-17 16:06:42 -06:00