Commit Graph

7716 Commits

Author SHA1 Message Date
Mike Bayer ee7bb9c174 Improvements to Connection auto-invalidation
handling.  If a non-disconnect error occurs,
but leads to a delayed disconnect error within error
handling (happens with MySQL), the disconnect condition
is detected.  The Connection can now also be closed
when in an invalid state, meaning it will raise "closed"
on next usage, and additionally the "close with result"
feature will work even if the autorollback in an error
handling routine fails and regardless of whether the
condition is a disconnect or not.
[ticket:2695]
2013-04-11 19:10:02 -04:00
Mike Bayer f35987d31a fix category 2013-04-11 16:51:27 -04:00
Mike Bayer 0d6e297d1f indentation fix 2013-04-11 16:33:53 -04:00
Mike Bayer a5ede47f12 A major fix to the way in which a select() object produces
labeled columns when apply_labels() is used; this mode
produces a SELECT where each column is labeled as in
<tablename>_<columnname>, to remove column name collisions
for a multiple table select.   The fix is that if two labels
collide when combined with the table name, i.e.
"foo.bar_id" and "foo_bar.id", anonymous aliasing will be
applied to one of the dupes.  This allows the ORM to handle
both columns independently; previously, 0.7
would in some cases silently emit a second SELECT for the
column that was "duped", and in 0.8 an ambiguous column error
would be emitted.   The "keys" applied to the .c. collection
of the select() will also be deduped, so that the "column
being replaced" warning will no longer emit for any select()
that specifies use_labels, though the dupe key will be given
an anonymous label which isn't generally user-friendly.
[ticket:2702]
2013-04-11 16:14:23 -04:00
Mike Bayer fa8c87eceb add calchipan 2013-04-10 14:02:24 -04:00
Mike Bayer 37a9c5f52d order by... 2013-04-09 14:48:59 -04:00
Mike Bayer d84ae4f754 Fixed indirect regression regarding :func:.has_inherited_table,
where since it considers the current class' ``__table__``, was
sensitive to when it was called.  This is 0.7's behavior also,
but in 0.7 things tended to "work out" within events like
``__mapper_args__()``.  :func:`.has_inherited_table` now only
considers superclasses, so should return the same answer
regarding the current class no matter when it's called
(obviously assuming the state of the superclass).
[ticket:2656]
2013-04-09 14:21:40 -04:00
Mike Bayer 70a173d22b 0.7 changelog 2013-04-09 12:01:31 -04:00
Mike Bayer df4e59ff55 Fixed bug when a query of the form:
``query(SubClass).options(subqueryload(Baseclass.attrname))``,
where ``SubClass`` is a joined inh of ``BaseClass``,
would fail to apply the ``JOIN`` inside the subquery
on the attribute load, producing a cartesian product.
The populated results still tended to be correct as additional
rows are just ignored, so this issue may be present as a
performance degradation in applications that are
otherwise working correctly. [ticket:2699]
2013-04-09 11:52:21 -04:00
Mike Bayer 6bdd3bb93f - reinstate insert returning back into test_insert.py; defaultdialect
needs to be explicit here since tablestest sticks testing.db onto metadata.bind
2013-04-01 15:41:57 -04:00
Mike Bayer 5ee1bb09de merge default 2013-04-01 13:57:44 -04:00
Mike Bayer 82b6e07492 - Fixed bug in unit of work whereby a joined-inheritance
subclass could insert the row for the "sub" table
  before the parent table, if the two tables had no
  ForeignKey constraints set up between them.
  Also in 0.7.11. [ticket:2689]
- fix a glitch in the assertsql.CompiledSQL fixture regarding
when a multiparam compiledSQL is used within an AllOf
- add a new utility function randomize_unitofwork() which
does the function of --reversetop
2013-04-01 13:37:35 -04:00
Diana Clarke 25c6732019 moving insert returning test back into CRUD test class until I figure out why moving it broke the oracle/postgres builds 2013-03-30 09:30:58 -04:00
Diana Clarke 2fa9dd6bb8 whitespace 2013-03-30 01:39:40 -04:00
Diana Clarke 2ffc925588 move the update tests from CRUDTest into sql/test_update.py (see #2630) 2013-03-30 01:38:17 -04:00
Diana Clarke e6d6cfbf6b fixing tests for --db=mysql: VARCHAR requires a length on dialect mysql 2013-03-30 01:01:59 -04:00
Diana Clarke 192bddc720 starting on the update tests next, pep8 pass first (see #2630) 2013-03-30 00:33:07 -04:00
Diana Clarke 17487a0db7 move the insert tests from CRUDTest into sql/test_insert.py (see #2630) 2013-03-29 19:10:01 -04:00
Diana Clarke 0f203d57cd move the delete tests from CRUDTest into sql/test_delete.py (see #2630) 2013-03-29 17:25:39 -04:00
Mike Bayer 7dff6f6d49 - test all pymssql messages here
- changelog
2013-03-29 12:09:11 -04:00
Mike Bayer 7aea1bfc8e Merged in sontek/sqlalchemy/add_better_disconnect_checks (pull request #47)
Add disconnect check on timeouts
2013-03-29 12:03:17 -04:00
Mike Bayer c87f6af48c - add a nose runner that erases out argv, otherwise
you get "import test" as what it tries to run with
setup.py test
2013-03-25 16:59:27 -04:00
Mike Bayer 07c9bc77f7 - limit some of these on views, indexes, pk constraints being available 2013-03-24 18:24:21 -04:00
Mike Bayer 9ca5b47fc9 merge default 2013-03-24 14:32:50 -04:00
Mike Bayer 728e272201 Merged in msabramo/sqlalchemy (pull request #48)
Make MonkeyPatchedBinaryTest only run when using mssql. Prevents failed
2013-03-24 14:32:19 -04:00
Mike Bayer 5e66224d63 - add an event to testing so that other dialects can intercept "test_needs_autoincrement"
- get the assumption of "1" for "first sequence item" to be dialect configured
2013-03-24 14:31:48 -04:00
Mike Bayer a4703917d8 Loosened the check on dialect-specific argument names
passed to Table(); since we want to support external dialects
and also want to support args without a certain dialect
being installed, it only checks the format of the arg now,
rather than looking for that dialect in sqlalchemy.dialects.
2013-03-24 13:50:56 -04:00
Mike Bayer b5b751e3de fix syntax error 2013-03-24 13:45:37 -04:00
Mike Bayer 35c5fd3fba Fixed bug whereby a DBAPI that can return "0"
for cursor.lastrowid would not function correctly
in conjunction with :attr:`.ResultProxy.inserted_primary_key`.
2013-03-23 19:00:11 -04:00
Mike Bayer e69b9542a8 Merged in tshepang/sqlalchemy/grammar (pull request #51)
fix grammar
2013-03-23 11:30:28 -04:00
Mike Bayer e717b57590 Merged in tshepang/sqlalchemy/typos (pull request #52)
remove mistakenly-repeated words
2013-03-23 11:22:42 -04:00
Tshepang Lekhonkhobe fd23be645e fix grammar 2013-03-23 13:58:16 +02:00
Tshepang Lekhonkhobe 56ec242999 remove mistakenly-repeated words 2013-03-23 13:42:10 +02:00
Marc Abramowitz f79b41243d Make MonkeyPatchedBinaryTest not fail on Python 2.5 (which doesn't have
the `b` notation for byte string literals)
2013-03-20 22:37:05 -07:00
Marc Abramowitz e90b2ccdfb Make MonkeyPatchedBinaryTest only run when using mssql. Prevents failed
tests when using a different dialect.
2013-03-18 15:29:54 -07:00
John Anderson eefa4b68f5 cleaned up errors, only check for connection timeout for now 2013-03-18 15:04:30 -07:00
John Anderson cb43db6bd1 Added disconnect checks for timeout, unable to read, and unable to write 2013-03-18 14:49:28 -07:00
Mike Bayer 25f1487d60 changelog 2013-03-18 14:20:28 -07:00
Mike Bayer ed58169c83 Merged in msabramo/sqlalchemy/trac_ticket_2683 (pull request #46)
dialects/mssql/pymssql.py: Modify module.Binary to work properly with byte strings in Python 3
2013-03-18 14:18:38 -07:00
Marc Abramowitz 40b99602c6 dialects/mssql/pymssql.py: Modify module.Binary to work properly with
byte strings in Python 3

Fixes http://www.sqlalchemy.org/trac/ticket/2683
2013-03-18 13:43:46 -07:00
Marc Abramowitz c97889af6d Add a test for http://www.sqlalchemy.org/trac/ticket/2683
This test currently passes in Python 2 but fails in Python 3.
2013-03-18 13:38:54 -07:00
Mike Bayer 9ad9ccec87 0.8.1 bump + test, changelog for hstore fix [ticket:2680] 2013-03-18 12:55:56 -07:00
Ben Trofatter 5b00c6555f Corrected silly circular import introduced by original "fix". 2013-03-18 12:40:40 -07:00
Ben Trofatter 33367fd1ee Added HSTORE to ischema_names in dialects/postgresql/base.py 2013-03-18 12:20:37 -07:00
Mike Bayer 72c4bdf735 merge plus fix the test spelling too 2013-03-18 11:00:47 -07:00
Richard Mitchell c3e1ef81db Fix typo. 2013-03-18 17:40:23 +00:00
Mike Bayer de9525a73e no need to use getattr() here 2013-03-17 23:29:24 -07:00
Mike Bayer 7138b4f987 some profiles 2013-03-17 23:29:16 -07:00
Mike Bayer 97d7123674 doc updates 2013-03-11 17:52:41 -04:00
Mike Bayer 522b426a1c - repair doctest for SQL expression tutorial
- remove most use of "whereclause" and "from_obj", not done yet,
part of [ticket:2679]
- add links to method chained versions for all Select.append_XYZ()
calls
- add "method chaining" and "generative" to glossary
2013-03-11 14:44:26 -04:00