Commit Graph

632 Commits

Author SHA1 Message Date
Mike Bayer 6d5eae78a7 - A DBAPI that raises an error on `connect()` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged.  Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`.  It is now propagated unchanged
in the same way as occurs within the execute process. [ticket:2881]
- add tests for this in test_parseconnect, but also add tests in test_execute
to ensure the execute() behavior as well
2013-12-07 17:20:05 -05:00
Mike Bayer d1cc78479d - The :class:.QueuePool has been enhanced to not block new connection
attempts when an existing connection attempt is blocking.  Previously,
the production of new connections was serialized within the block
that monitored overflow; the overflow counter is now altered within
it's own critical section outside of the connection process itself.
[ticket:2880]
2013-12-06 19:57:19 -05:00
Mike Bayer 003b288b76 - Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.
2013-12-06 16:33:42 -05:00
Mike Bayer 604df86190 make sure thread.join() is used completely here 2013-11-30 16:54:44 -05:00
Mike Bayer 6029496bd3 - adjustment, the spec says: "Within the user and password field, any ":",
"@", or "/" must be encoded." - so re-apply encoding to both password
and username, don't encode spaces as plus signs, don't encode any chars
outside of :, @, / on stringification - but we still parse for any
%XX character (is that right?)
2013-11-25 14:46:58 -05:00
Mike Bayer 2800e34710 - The :func:.create_engine routine and the related
:func:`.make_url` function **no longer URL encode the password**.
Database passwords that include characters like spaces, plus signs
and anything else should now represent these characters directly,
without any URL escaping. [ticket:2873]
2013-11-24 18:11:37 -05:00
Mike Bayer 54b8969be1 -be more agnostic of quotes here 2013-11-23 17:22:56 -05:00
Mike Bayer f112dc1d53 - Fixed bug where SQL statement would be improperly ASCII-encoded
when a pre-DBAPI :class:`.StatementError` were raised within
:meth:`.Connection.execute`, causing encoding errors for
non-ASCII statements.  The stringification now remains within
Python unicode thus avoiding encoding errors. [ticket:2871]
2013-11-22 18:35:36 -05:00
Mike Bayer fcbaf666a9 something changed the name here, probably one of those doc pullreqs 2013-11-21 17:24:51 -05:00
Mike Bayer 1a809b300e - apply a timeout to all join() calls for test_pool
- use thread.join() for waiters_handled test
2013-11-17 14:35:11 -05:00
Mike Bayer 59ca4633ac - remove informix dialect, moved out to https://bitbucket.org/zzzeek/sqlalchemy_informixdb
- remove informix, maxdb, access symbols from tests etc.
2013-11-17 13:45:23 -05:00
Mike Bayer 46ac022e57 - move this test to PG test_reflection
- don't use locals()
2013-10-25 17:19:03 -04:00
Mike Bayer e5a42a748b Merge branch 'master' of github.com:ijl/sqlalchemy into merge_2183 2013-10-25 17:01:38 -04:00
Mike Bayer 382cd56772 - The regexp used by the :func:.url.make_url function now parses
ipv6 addresses, e.g. surrounded by brackets. [ticket:2851]
2013-10-23 15:02:36 -04:00
Mike Bayer cdc9475b0b try to get this to pass on slow environmnets 2013-10-21 23:17:36 -04:00
ijl f17e8a4452 ForeignKeyConstraint reflection test respects MySQL limitations 2013-10-15 16:01:25 -04:00
ijl 52cfa74e09 #2183: Metadata.reflect() foreign keys include options when the dialect exposes it 2013-10-13 17:13:28 -04:00
mike bayer dda72ddcf0 Merge pull request #25 from gthb/ticket_2821
Hide password in URL and Engine __repr__
2013-09-29 14:03:46 -07:00
Mike Bayer 08a6a8b519 - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynor 2013-09-22 20:35:40 -04:00
Gunnlaugur Þór Briem 610684bb08 Hide password in URL and Engine __repr__
Fixes #2821
2013-09-06 17:57:04 +00:00
Mike Bayer 21fac20884 use a different col here to keep oracle happy 2013-09-02 12:11:24 -04:00
Mike Bayer 97168dbf69 plus some more adjustments for mysql, or in general if an Index refers to
in-python only cols
2013-08-28 17:31:40 -04:00
Mike Bayer fe66951f5d Fixed bug where using the `column_reflect event to change the .key`
of the incoming :class:`.Column` would prevent primary key constraints,
indexes, and foreign key constraints from being correctly reflected.
Also in 0.8.3. [ticket:2811]
2013-08-28 17:25:44 -04:00
Mike Bayer e9c748a7bf - ensure rowcount is returned for an UPDATE with no implicit returning
- modernize test for that
- use py3k compatible next() in test_returning/test_versioning
2013-08-25 17:37:59 -04:00
Mike Bayer b83a1564f1 Improved support for the cymysql driver, supporting version 0.6.5,
courtesy Hajime Nakagami.
2013-08-17 00:31:57 -04:00
Mike Bayer f6198d9abf - A large refactoring of the `sqlalchemy.sql` package has reorganized
the import structure of many core modules.
``sqlalchemy.schema`` and ``sqlalchemy.types``
remain in the top-level package, but are now just lists of names
that pull from within ``sqlalchemy.sql``.  Their implementations
are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``,
``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was
moved from ``sqlalchemy.engine``.  ``sqlalchemy.sql.expression`` is also
a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``,
``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``.
Most of the "factory" functions
used to create SQL expression objects have been moved to classmethods
or constructors, which are exposed in ``sqlalchemy.sql.expression``
using a programmatic system.  Care has been taken such that all the
original import namespaces remain intact and there should be no impact
on any existing applications.   The rationale here was to break out these
very large modules into smaller ones, provide more manageable lists
of function names, to greatly reduce "import cycles" and clarify the
up-front importing of names, and to remove the need for redundant
functions and documentation throughout the expression package.
2013-08-12 17:50:37 -04:00
Mike Bayer 59675be673 try seeing if just clearing this ahead of time helps 2013-07-27 18:32:38 -04:00
Mike Bayer 5dbe771922 further tweaking 2013-07-13 16:41:16 -04:00
Mike Bayer c896c75971 fix the scoping here 2013-07-13 16:37:10 -04:00
Mike Bayer fd55be01dd Dialect.initialize() is not called a second time if an :class:.Engine
is recreated, due to a disconnect error.   This fixes a particular
issue in the Oracle 8 dialect, but in general the dialect.initialize()
phase should only be once per dialect.  Also in 0.8.3. [ticket:2776]
2013-07-11 15:15:09 -04:00
Mike Bayer f390639bf1 Fixed bug where :class:.QueuePool would lose the correct
checked out count if an existing pooled connection failed to reconnect
after an invalidate or recycle event.  Also in 0.8.3.
[ticket:2772]
2013-07-04 13:18:00 -04:00
Mike Bayer d3d10c982c - refactor pool a bit so that intent between ConnectionRecord/ConnectionFairy is clear;
make sure that the DBAPI connection passed to the reset-on-return events/dialect hooks
is also a "fairy", so that dictionaries like "info" are available.  [ticket:2770]
- rework the execution_options system so that the dialect is given the job of making
any immediate adjustments based on a set event.  move the "isolation level" logic to use
this new system.   Also work things out so that even engine-level execution options
can be used for things like isolation level; the dialect attaches a connect-event
handler in this case to handle the task.
- to support this new system as well as further extensibiltiy of execution options
add events engine_connect(), set_connection_execution_options(), set_engine_execution_options()
2013-07-02 13:14:21 -04:00
Mike Bayer 38c5e870a7 mark the tests that seem to be segfauling py3k+coverage so that we can exclude them
at the nose command line
2013-06-30 23:55:32 -04:00
Mike Bayer b38a76cd1d - replace most explicitly-named test objects called "Mock..." with
actual mock objects from the mock library.  I'd like to use mock
for new tests so we might as well use it in obvious places.
- use unittest.mock in py3.3
- changelog
- add a note to README.unittests
- add tests_require in setup.py
- have tests import from sqlalchemy.testing.mock
- apply usage of mock to one of the event tests.  we can be using
this approach all over the place.
2013-06-30 18:35:12 -04:00
Mike Bayer 278c243aa3 tweak the timings here to maximize chance of test success 2013-06-29 11:17:32 -04:00
Eevee 23ce1d8b12 Preserve reset_on_return when recreating a Pool. 2013-06-10 15:04:39 -07:00
Mike Bayer 258d2a8315 - get_unique_constraints() pull request
- version (0.9 for now)
- changelog
- move the test into the test suite so that all dialects can take advantage of it
2013-06-09 17:54:11 -04:00
Roman Podolyaka c69fe4acf8 Add basic support of unique constraints reflection
Inspection API already supports reflection of table
indexes information and those also include unique
constraints (at least for PostgreSQL and MySQL).
But it could be actually useful to distinguish between
indexes and plain unique constraints (though both are
implemented in the same way internally in RDBMS).

This change adds a new method to Inspection API - get_unique_constraints()
and implements it for SQLite, PostgreSQL and MySQL dialects.
2013-06-09 23:49:55 +03:00
Mike Bayer f1bdc3e999 - clean up some of the requires for cross-schema reflection
- add oracle profile counts
2013-06-03 18:11:32 -04:00
Mike Bayer ec04620f1f Fixed bug whereby using :meth:.MetaData.reflect across a remote
schema as well as a local schema could produce wrong results
in the case where both schemas had a table of the same name.
[ticket:2728]
2013-06-03 16:40:59 -04:00
Mike Bayer f9bb6c2a54 - additional oracle fixes. cx_oracle under py3k is complaining about tuples to executemany(),
so just unconditionally turn this into a list
- this one test segfaults only on py3k + cx_oracle
2013-05-27 17:06:05 -04:00
Mike Bayer 4276049e49 fix test_execute w c extensions 2013-05-26 20:44:34 -04:00
Mike Bayer cca97433c1 merge default 2013-05-05 01:42:26 -04:00
Mike Bayer 31792e86ae - cleanup
- move the timeout here to 14 seconds as jenkins still chokes occasionally
2013-05-05 01:39:35 -04:00
Mike Bayer 021b5143e6 that's all of engine 2013-05-04 15:57:03 -04:00
Mike Bayer 6c8b8da877 cleanup 2013-05-04 15:35:47 -04:00
Mike Bayer ef629e7b3d cleanup 2013-05-04 15:35:47 -04:00
Mike Bayer 920e134d53 test_execute up for sqlite, pg, oursql, mysql 2.7 + 3.3 2013-05-04 15:29:04 -04:00
Mike Bayer be523db4a2 merge default 2013-04-30 10:03:14 -04:00
Mike Bayer 62eeb1bf26 missing comma 2013-04-30 00:15:36 -04:00