diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-13 10:36:16 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-13 13:06:02 -0400 |
| commit | 25b8e89d3d425656e51438b5cac7e6e1f2592817 (patch) | |
| tree | 66d2b0c07245f084ad4058c35c502d51332fd192 /lib/sqlalchemy/testing/suite/test_results.py | |
| parent | a4bfde4a18e50d93e44aec5c6216be8a6f9fbacb (diff) | |
| download | sqlalchemy-25b8e89d3d425656e51438b5cac7e6e1f2592817.tar.gz | |
Deprecate engine-wise ss cursors; repair mariadbconnector
The server_side_cursors engine-wide feature relies upon
regexp parsing of statements a well as general guessing as
to when the feature should be used. This is not within the
2.0 way of doing things and should be removed.
Additionally, mariadbconnector defaults to unbuffered cursors;
add new cursor hooks so that mariadbconnector can specify
buffered or unbuffered cursors without too much difficulty.
This will also correctly default mariadbconnector to buffered
cursors which should repair the segfaults we've been getting.
Try to restore the assert_raises that was removed in
5b6dfc0c38bf1f01da4b8 to see if mariadbconnector segfaults
are resolved.
Change-Id: I77f1c972c742e40694972f578140bb0cac8c39eb
Diffstat (limited to 'lib/sqlalchemy/testing/suite/test_results.py')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_results.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py index 6d28a207e..1c1b20cf0 100644 --- a/lib/sqlalchemy/testing/suite/test_results.py +++ b/lib/sqlalchemy/testing/suite/test_results.py @@ -236,15 +236,28 @@ class ServerSideCursorsTest( elif self.engine.dialect.driver == "mysqldb": sscursor = __import__("MySQLdb.cursors").cursors.SSCursor return isinstance(cursor, sscursor) + elif self.engine.dialect.driver == "mariadbconnector": + return not cursor.buffered elif self.engine.dialect.driver == "asyncpg": return cursor.server_side else: return False def _fixture(self, server_side_cursors): - self.engine = engines.testing_engine( - options={"server_side_cursors": server_side_cursors} - ) + if server_side_cursors: + with testing.expect_deprecated( + "The create_engine.server_side_cursors parameter is " + "deprecated and will be removed in a future release. " + "Please use the Connection.execution_options.stream_results " + "parameter." + ): + self.engine = engines.testing_engine( + options={"server_side_cursors": server_side_cursors} + ) + else: + self.engine = engines.testing_engine( + options={"server_side_cursors": server_side_cursors} + ) return self.engine def tearDown(self): |
