]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Changed the default value of "raise_on_warnings" to False for
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Jul 2014 20:04:07 +0000 (16:04 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Jul 2014 20:04:07 +0000 (16:04 -0400)
MySQLconnector.  This was set at True for some reason.  The "buffered"
flag unfortunately must stay at True as MySQLconnector does not allow
a cursor to be closed unless all results are fully fetched. fixes #2515
- lots of MySQL tests seemed to not be hitting all backends, so we should
be getting some mysqlconnector failures now

doc/build/changelog/changelog_10.rst
lib/sqlalchemy/dialects/mysql/mysqlconnector.py
test/dialect/mysql/test_dialect.py
test/dialect/mysql/test_query.py
test/dialect/mysql/test_reflection.py
test/dialect/mysql/test_types.py

index de351326ed5a56bd3226882f2ce83ba1ec7eac72..57ca3c863e77e0e757bc5b88cf0c60d69d17b249 100644 (file)
 .. changelog::
        :version: 1.0.0
 
+    .. change::
+        :tags: mysql, bug
+        :tickets: 2515
+
+        Changed the default value of "raise_on_warnings" to False for
+        MySQLconnector.  This was set at True for some reason.  The "buffered"
+        flag unfortunately must stay at True as MySQLconnector does not allow
+        a cursor to be closed unless all results are fully fetched.
+
     .. change::
         :tags: bug, orm
         :tickets: 3117
index 3536c3ad81e8741c267dc8f7ec9d81d920cf9134..83e731c16306b2820f469b1e20e9d3b292ad1889 100644 (file)
@@ -87,8 +87,10 @@ class MySQLDialect_mysqlconnector(MySQLDialect):
 
         util.coerce_kw_type(opts, 'buffered', bool)
         util.coerce_kw_type(opts, 'raise_on_warnings', bool)
+
+        # unfortunately, MySQL/connector python refuses to release a
+        # cursor without reading fully, so non-buffered isn't an option
         opts.setdefault('buffered', True)
-        opts.setdefault('raise_on_warnings', True)
 
         # FOUND_ROWS must be set in ClientFlag to enable
         # supports_sane_rowcount.
index 2ff17f0f7340010f73b781e657407029dd4408a5..e6bad71a44332477a74530ec6a5a2dd8bfc67e81 100644 (file)
@@ -69,10 +69,11 @@ class DialectTest(fixtures.TestBase):
             )[1]
         eq_(kw['raise_on_warnings'], False)
 
+
         kw = dialect.create_connect_args(
                 make_url("mysql+mysqlconnector://u:p@host/db")
             )[1]
-        eq_(kw['raise_on_warnings'], True)
+        assert "raise_on_warnings" not in kw
 
     @testing.only_on('mysql')
     def test_random_arg(self):
@@ -84,11 +85,11 @@ class DialectTest(fixtures.TestBase):
 
 class SQLModeDetectionTest(fixtures.TestBase):
     __only_on__ = 'mysql'
+    __backend__ = True
 
     def _options(self, modes):
         def connect(con, record):
             cursor = con.cursor()
-            print("DOING THiS:", "set sql_mode='%s'" % (",".join(modes)))
             cursor.execute("set sql_mode='%s'" % (",".join(modes)))
         e = engines.testing_engine(options={
             'pool_events':[
@@ -131,6 +132,7 @@ class ExecutionTest(fixtures.TestBase):
     """Various MySQL execution special cases."""
 
     __only_on__ = 'mysql'
+    __backend__ = True
 
     def test_charset_caching(self):
         engine = engines.testing_engine()
index 040004808635bb30ea9bbdfbf24a9f69248fc01c..dd11fe2b4965af30b2f2f74029513091df876b50 100644 (file)
@@ -8,6 +8,7 @@ from sqlalchemy import testing
 
 class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
     __only_on__ = 'mysql'
+    __backend__ = True
 
     @classmethod
     def setup_class(cls):
index c8fdc9310bca825060c8de3aac6a0444c576f850..bf35a2c6bf4af3c49b1ab18f260c07ea0cb74f2b 100644 (file)
@@ -10,6 +10,7 @@ from sqlalchemy import testing
 class ReflectionTest(fixtures.TestBase, AssertsExecutionResults):
 
     __only_on__ = 'mysql'
+    __backend__ = True
 
     def test_default_reflection(self):
         """Test reflection of column defaults."""
index b7d261a8864bd299b78cabb71dea679874978385..f5901812e7e34f3bdb0d5da3781829c9253b0d52 100644 (file)
@@ -15,6 +15,7 @@ class TypesTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
     "Test MySQL column types"
 
     __dialect__ = mysql.dialect()
+    __backend__ = True
 
     def test_numeric(self):
         "Exercise type specification and options for numeric types."
@@ -257,7 +258,7 @@ class TypesTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
                 res
             )
 
-    @testing.only_if('mysql')
+    @testing.only_if('mysql+mysqldb')
     @testing.exclude('mysql', '<', (5, 0, 5), 'a 5.0+ feature')
     @testing.provide_metadata
     def test_charset_collate_table(self):
@@ -554,6 +555,7 @@ class EnumSetTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL
 
     __only_on__ = 'mysql'
     __dialect__ = mysql.dialect()
+    __backend__ = True
 
 
     @testing.provide_metadata