summaryrefslogtreecommitdiff
path: root/test/engine
Commit message (Collapse)AuthorAgeFilesLines
* - 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
|/
* - workaround removal of nested() in py3kMike Bayer2014-07-301-1/+2
|
* - ensure all tests are named test_*Mike Bayer2014-07-303-8/+9
|
* pep8 cleanupMike Bayer2014-07-291-285/+342
|
* - The exception wrapping system for DBAPI errors can now accommodateMike Bayer2014-07-291-1/+26
| | | | | | | | non-standard DBAPI exceptions, such as the psycopg2 TransactionRollbackError. These exceptions will now be raised using the closest available subclass in ``sqlalchemy.exc``, in the case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``. fixes #3075
* - add support for tags, including include/exclude support.Mike Bayer2014-07-271-5/+13
| | | | simplify tox again now that we can exclude tests more easily
* Merge branch 'master' into xdist_pocMike Bayer2014-07-261-2/+3
|\
| * fix paren hereMike Bayer2014-07-261-2/+3
| |
* | - scale up for mysql, sqliteMike Bayer2014-07-261-9/+14
|/
* - more pg8000 tests passingMike Bayer2014-07-253-4/+4
|
* - The MySQL dialect will now disable :meth:`.ConnectionEvents.handle_error`Mike Bayer2014-07-251-0/+28
| | | | | | | | | | events from firing for those statements which it uses internally to detect if a table exists or not. This is achieved using an execution option ``skip_user_error_events`` that disables the handle error event for the scope of that execution. In this way, user code that rewrites exceptions doesn't need to worry about the MySQL dialect or other dialects that occasionally need to catch SQLAlchemy specific exceptions.
* Merge pull request #100 from plaes/typosmike bayer2014-07-061-2/+2
|\ | | | | Typo fixes
| * typo: s/thbe/thepr/100Priit Laes2014-06-281-1/+1
| |
| * typo: s/tranasction/transactionPriit Laes2014-06-281-2/+2
| |
* | - add test support for disconnect modificationMike Bayer2014-07-041-0/+25
| |
* | - rework the entire approach to #3076. As we need to catch all exceptionsMike Bayer2014-07-041-125/+267
| | | | | | | | | | | | | | | | | | | | | | in all cases unconditionally, the number of use cases that go beyond what dbapi_error() is expecting has gone too far for an 0.9 release. Additionally, the number of things we'd like to track is really a lot more than the five arguments here, and ExecutionContext is really not suitable as totally public API for this. So restore dbapi_error to its old version, deprecate, and build out handle_error instead. This is a lot more extensible and doesn't get in the way of anything compatibility-wise.
* | - The mechanics of the :meth:`.ConnectionEvents.dbapi_error` handlerMike Bayer2014-07-031-0/+111
|/ | | | | | | have been enhanced such that the function handler is now capable of raising or returning a new exception object, which will replace the exception normally being thrown by SQLAlchemy. fixes #3076