summaryrefslogtreecommitdiff
path: root/test/engine
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed critical issue whereby the pool "checkout" event handlerMike Bayer2015-07-221-1/+94
| | | | | | | | | | | | may be called against a stale connection without the "connect" event handler having been called, in the case where the pool attempted to reconnect after being invalidated and failed; the stale connection would remain present and would be used on a subsequent attempt. This issue has a greater impact in the 1.0 series subsequent to 1.0.2, as it also delivers a blanked-out ``.info`` dictionary to the event handler; prior to 1.0.2 the ``.info`` dictionary is still the previous one. fixes #3497
* - remove the redundant non-max-row-buffer test from the max_row_bufferMike Bayer2015-06-141-12/+0
| | | | test as we implemented that as a separate test.
* - add test cases for pullreq github:182, where we add a newMike Bayer2015-06-141-47/+110
| | | | | | | | "max_row_buffer" execution option for BufferedRowResultProxy - also add documentation, changelog and version notes - rework the max_row_buffer argument to be interpreted from the execution options upfront when the BufferedRowResultProxy is first initialized.
* - Added new engine event :meth:`.ConnectionEvents.engine_disposed`.Mike Bayer2015-06-061-0/+26
| | | | Called after the :meth:`.Engine.dispose` method is called.
* - Fixed bug where known boolean values used byMike Bayer2015-05-261-0/+17
| | | | | | | | :func:`.engine_from_config` were not being parsed correctly; these included ``pool_threadlocal`` and the psycopg2 argument ``use_native_unicode``. fixes #3435 - add legacy_schema_aliasing config parsing for mssql - move use_native_unicode config arg to the psycopg2 dialect
* - fix some tests related to the URL change and try to makeMike Bayer2015-05-231-0/+4
| | | | the URL design a little simpler
* - Fixed bug where in the case that a pool checkout event handler is usedMike Bayer2015-05-141-17/+48
| | | | | | | | | | | | | | | | | and the database can no longer be connected towards, that the checkout handler failure is caught, the attempt to re-acquire the connection also raises an exception, but the underlying connection record is not immediately re-checked in before the exception is propagated outwards, having the effect that the checked-out record does not close itself until the stack trace it's associated with is garbage collected, preventing that record from being used for a new checkout until we leave the scope of the stack trace. This can lead to confusion in the specific case of when the number of current stack traces in memory exceeds the number of connections the pool can return, as the pool will instead begin to raise errors about no more checkouts available, rather than attempting a connection again. The fix applies a checkin of the record before re-raising. fixes #3419
* - revise the last commit with a more traditional approachMike Bayer2015-04-301-6/+1
| | | | using descriptors; ensure that mock.patch() honors descriptor setters
* - work the wrapping of the "creator" to be as resilient toMike Bayer2015-04-302-1/+56
| | | | | old / new style, direct access, and ad-hoc patching and unpatching as possible
* - New features added to support engine/pool plugins with advancedMike Bayer2015-04-303-5/+251
| | | | | | | | | | | | | | | | | | | | | | | | | functionality. Added a new "soft invalidate" feature to the connection pool at the level of the checked out connection wrapper as well as the :class:`._ConnectionRecord`. This works similarly to a modern pool invalidation in that connections aren't actively closed, but are recycled only on next checkout; this is essentially a per-connection version of that feature. A new event :class:`.PoolEvents.soft_invalidate` is added to complement it. fixes #3379 - Added new flag :attr:`.ExceptionContext.invalidate_pool_on_disconnect`. Allows an error handler within :meth:`.ConnectionEvents.handle_error` to maintain a "disconnect" condition, but to handle calling invalidate on individual connections in a specific manner within the event. - Added new event :class:`.DialectEvents.do_connect`, which allows interception / replacement of when the :meth:`.Dialect.connect` hook is called to create a DBAPI connection. Also added dialect plugin hooks :meth:`.Dialect.get_dialect_cls` and :meth:`.Dialect.engine_created` which allow external plugins to add events to existing dialects using entry points. fixes #3355
* - replace old crufty ddl event test fixture with mockMike Bayer2015-04-271-95/+164
|
* - Fixed regression due to :ticket:`3282` where the ``tables`` collectionMike Bayer2015-04-271-2/+53
| | | | | | | | | | | | | | | | passed as a keyword argument to the :meth:`.DDLEvents.before_create`, :meth:`.DDLEvents.after_create`, :meth:`.DDLEvents.before_drop`, and :meth:`.DDLEvents.after_drop` events would no longer be a list of tables, but instead a list of tuples which contained a second entry with foreign keys to be added or dropped. As the ``tables`` collection, while documented as not necessarily stable, has come to be relied upon, this change is considered a regression. Additionally, in some cases for "drop", this collection would be an iterator that would cause the operation to fail if prematurely iterated. The collection is now a list of table objects in all cases and test coverage for the format of this collection is now added. fixes #3391
* - Added the string value ``"none"`` to those accepted by theMike Bayer2015-04-211-0/+15
| | | | | | | | :paramref:`.Pool.reset_on_return` parameter as a synonym for ``None``, so that string values can be used for all settings, allowing .ini file utilities like :func:`.engine_from_config` to be usable without issue. fixes #3375
* Merge remote-tracking branch 'origin/pr/163' into pr163Mike Bayer2015-04-126-79/+160
|\
| * PEP8 cleanup in /test/enginepr/163Eric Streeper2015-03-206-79/+160
| |
* | - add some teardown for connections that are held open after testsMike Bayer2015-04-081-6/+18
|/ | | | in some cases, interfering with tests that check pool._refs
* - The "auto close" for :class:`.ResultProxy` is now a "soft" close.Mike Bayer2015-03-171-0/+41
| | | | | | | | | | | That is, after exhausing all rows using the fetch methods, the DBAPI cursor is released as before and the object may be safely discarded, but the fetch methods may continue to be called for which they will return an end-of-result object (None for fetchone, empty list for fetchmany and fetchall). Only if :meth:`.ResultProxy.close` is called explicitly will these methods raise the "result is closed" error. fixes #3330 fixes #3329
* - Fixed bug in :class:`.Connection` and pool where theMike Bayer2015-02-042-0/+22
| | | | | | | | | :meth:`.Connection.invalidate` method, or an invalidation due to a database disconnect, would fail if the ``isolation_level`` parameter had been used with :meth:`.Connection.execution_options`; the "finalizer" that resets the isolation level would be called on the no longer opened connection. fixes #3302
* - A warning is emitted if the ``isolation_level`` parameter is usedMike Bayer2015-02-041-3/+25
| | | | | | | | | | | | | | | | with :meth:`.Connection.execution_options` when a :class:`.Transaction` is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2, MySQLdb may implicitly rollback or commit the transaction, or not change the setting til next transaction, so this is never safe. - Added new parameter :paramref:`.Session.connection.execution_options` which may be used to set up execution options on a :class:`.Connection` when it is first checked out, before the transaction has begun. This is used to set up options such as isolation level on the connection before the transaction starts. - added new documentation section detailing best practices for setting transaction isolation with sessions. fixes #3296
* - additional test adjustments for pypy / psycopg2cffi. ThisMike Bayer2015-01-261-24/+26
| | | | | | | | | | consists mainly of adjusting fixtures to ensure connections are closed explicitly. psycopg2cffi also handles unicode bind parameter names differently than psycopg2, and seems to possibly have a little less control over floating point values at least in one test which is marked as a "fail", though will see if it runs differently on linux than osx.. - changelog for psycopg2cffi, fixes #3052
* Added psycopg2cffi dialectShaun Stanworth2015-01-261-1/+1
|
* - Added new user-space accessors for viewing transaction isolationMike Bayer2015-01-202-0/+43
| | | | | | | | | levels; :meth:`.Connection.get_isolation_level`, :attr:`.Connection.default_isolation_level`. - enhance documentation inter-linkage between new accessors, existing isolation_level parameters, as well as in the dialect-level methods which should be fully covered by Engine/Connection level APIs now.
* formattingMike Bayer2015-01-201-27/+30
|
* - rework the handle error on connect tests from test_parsconnect whereMike Bayer2014-12-102-236/+245
| | | | they don't really belong into a new suite in test_execute
* - identify another spot where _handle_dbapi_error() needs to do somethingMike Bayer2014-12-081-0/+28
| | | | | differently for the case where it is called in an already-invalidated state; don't call upon self.connection
* - simplify the "noconnection" error handling, settingMike Bayer2014-12-081-2/+2
| | | | | | | _handle_dbapi_exception_noconnection() to only invoke in the case of raw_connection() in the constructor of Connection. in all other cases the Connection proceeds with _handle_dbapi_exception() including revalidate.
* - adjust _revalidate_connection() again such that we pass a _wrap=FalseMike Bayer2014-12-052-3/+3
| | | | | | | | | | to it, so that we say we will do the wrapping just once right here in _execute_context() / _execute_default(). An adjustment is made to _handle_dbapi_error() to not assume self.__connection in case we are already in an invalidated state further adjustment to 0639c199a547343d62134d2f233225fd2862ec45, 41e7253dee168b8c26c49, #3266
* - move inner calls to _revalidate_connection() outside of existingMike Bayer2014-12-051-1/+34
| | | | | _handle_dbapi_error(); these are now handled already and the reentrant call is not needed / breaks things. Adjustment to 41e7253dee168b8c26c49 /
* - The engine-level error handling and wrapping routines will nowMike Bayer2014-12-051-1/+112
| | | | | | | | | take effect in all engine connection use cases, including when user-custom connect routines are used via the :paramref:`.create_engine.creator` parameter, as well as when the :class:`.Connection` encounters a connection error on revalidation. fixes #3266
* - pep8 cleanupMike Bayer2014-12-051-58/+77
|
* Merge branch 'master' into fdbsql-testsScott Dugas2014-11-034-144/+226
|\ | | | | | | | | Conflicts: lib/sqlalchemy/testing/exclusions.py
| * - control the module name of the exception here for py3k compatMike Bayer2014-10-191-7/+14
| |
| * - Exception messages have been spiffed up a bit. The SQL statementMike Bayer2014-10-172-6/+8
| | | | | | | | | | | | | | | | | | | | | | and parameters are not displayed if None, reducing confusion for error messages that weren't related to a statement. The full module and classname for the DBAPI-level exception is displayed, making it clear that this is a wrapped DBAPI exception. The statement and parameters themselves are bounded within a bracketed sections to better isolate them from the error message and from each other. fixes #3172
| * - adjustment for ref #3200 as we need an immutabledict() here soMike Bayer2014-10-071-0/+12
| | | | | | | | | | that union() can be called, in the case of a dialect that uses execution options inside of initialize() (e.g. oursql)
| * - The execution options passed to an :class:`.Engine` either viaMike Bayer2014-10-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | :paramref:`.create_engine.execution_options` or :meth:`.Engine.update_execution_options` are not passed to the special :class:`.Connection` used to initialize the dialect within the "first connect" event; dialects will usually perform their own queries in this phase, and none of the current available options should be applied here. In particular, the "autocommit" option was causing an attempt to autocommit within this initial connect which would fail with an AttributeError due to the non-standard state of the :class:`.Connection`. fixes #3200
| * - repair autorollback for branchesMike Bayer2014-09-261-0/+12
| |
| * - Fixed bug where a "branched" connection, that is the kind you getMike Bayer2014-09-263-10/+110
| | | | | | | | | | | | | | | | when you call :meth:`.Connection.connect`, would not share transaction status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all transactional status and operations. fixes #3190
| * - Fixed bug where a "branched" connection, that is the kind you getMike Bayer2014-09-261-0/+32
| | | | | | | | | | | | | | | | when you call :meth:`.Connection.connect`, would not share invalidation status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all invalidation status and operations. fixes #3215
| * - these tests don't test anything in SQLAlchemy - from our perpsective,Mike Bayer2014-09-191-133/+0
| | | | | | | | | | | | | | we need to be in transactions (tested elsewhere) and we need to emit the correct FOR UPDATE strings (tested elsewhere). There's nothing in SQLA to be tested as far as validating that for update causes exceptions or not, and these tests frequently fail as they are timing sensitive.
| * - Fixed bug that affected generally the same classes of eventMike Bayer2014-09-181-0/+42
| | | | | | | | | | | | | | | | | | | | as that of :ticket:`3199`, when the ``named=True`` parameter would be used. Some events would fail to register, and others would not invoke the event arguments correctly, generally in the case of when an event was "wrapped" for adaption in some other way. The "named" mechanics have been rearranged to not interfere with the argument signature expected by internal wrapper functions. fixes #3197
* | Added new requirement for check_constraintsScott Dugas2014-10-231-0/+1
|/
* - An adjustment to table/index reflection such that if an indexMike Bayer2014-09-021-0/+20
| | | | | | | reports a column that isn't found to be present in the table, a warning is emitted and the column is skipped. This can occur for some special system column situations as has been observed with Oracle. fixes #3180
* - Fixed bug in connection pool logging where the "connection checked out"Mike Bayer2014-08-201-2/+83
| | | | | | | | debug logging message would not emit if the logging were set up using ``logging.setLevel()``, rather than using the ``echo_pool`` flag. Tests to assert this logging have been added. This is a regression that was introduced in 0.9.0. fixes #3168
* - pep8 cleanupMike Bayer2014-08-202-25/+13
|
* Merge remote-tracking branch 'origin/pr/125' into pr125Mike Bayer2014-08-162-61/+56
|\
| * two_phase_recover, COMMIT PREPARED in transactionTony Locke2014-08-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In test/engine/test_transaction/test_two_phase_recover(), a COMMIT PREPARED is issued while in a transaction. This causes an error, and a prepared transaction is left hanging around which causes the subsequent test to hang. I've altered the test to execute the offending query with autocommit=true, then when it gets to the COMMIT PRPARED it can go ahead. There's another complication for pg8000 because its tpc_recover() method started a transaction if one wasn't already in progress. I've decided that this is incorrect behaviour and so from pg8000-1.9.13 this method never starts or stops a transaction.
| * PEP8 tidy of test/engine/test_reconnectTony Locke2014-08-021-58/+52
| |
* | - The string keys that are used to determine the columns impactedMike Bayer2014-08-141-3/+45
| | | | | | | | | | | | | | | | | | for an INSERT or UPDATE are now sorted when they contribute towards the "compiled cache" cache key. These keys were previously not deterministically ordered, meaning the same statement could be cached multiple times on equivalent keys, costing both in terms of memory as well as performance. fixes #3165
* | Providing an autoload_with info automatically sets autoload to TrueMalik Diarra2014-08-091-0/+16
| |
* | - take out the iterator approach here as it does not support concurrent accessMike Bayer2014-08-071-8/+9
|/