Skip to content

Commit 1a7360f

Browse files
committed
BUG19685386: C extension tests are failing using MySQL 5.7.4
This patch fixes bugs.BugOra16217765.test_sha256_nonssl, style.LintTests.test_lint and other tests that were failing using MySQL 5.7.4.
1 parent 0379c69 commit 1a7360f

14 files changed

+23
-14
lines changed

lib/mysql/connector/abstracts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/connection_cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/cursor_cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/fabric/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/fabric/caching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/locales/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

lib/mysql/connector/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most

src/mysql_capi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,6 @@ MySQL_connect(MySQL *self, PyObject *args, PyObject *kwds)
11271127
if (ssl_ca || ssl_cert || ssl_key) {
11281128
ssl_enabled= 1;
11291129
#if MYSQL_VERSION_ID > 50703 && MYSQL_VERSION_ID < 50711
1130-
printf(">>>> %d\n", MYSQL_VERSION_ID);
11311130
{
11321131
abool= 1;
11331132
mysql_options(&self->session, MYSQL_OPT_SSL_ENFORCE, (char*)&abool);

tests/cext/test_cext_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ def test_set_character_set(self):
530530
cmy1.set_character_set('big5')
531531
self.assertEqual(exp, get_variables(cmy1, variables=variables))
532532

533+
@unittest.skipIf(tests.MYSQL_VERSION == (5, 7, 4),
534+
"test_get_ssl_cipher not tested with MySQL version 5.7.4")
533535
def test_get_ssl_cipher(self):
534536
cmy1 = MySQL(buffered=True)
535537
self.assertRaises(MySQLInterfaceError, cmy1.get_ssl_cipher)

tests/test_abstracts.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MySQL Connector/Python - MySQL driver written in Python.
2-
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
33

44
# MySQL Connector/Python is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -194,7 +194,13 @@ def test_cmd_refresh(self):
194194
exp = {'insert_id': 0, 'affected_rows': 0,
195195
'field_count': 0, 'warning_count': 0,
196196
'status_flag': 0}
197-
self.assertEqual(exp, self.cnx.cmd_refresh(refresh))
197+
result = self.cnx.cmd_refresh(refresh)
198+
for key in set(result.keys()) ^ set(exp.keys()):
199+
try:
200+
del result[key]
201+
except KeyError:
202+
del exp[key]
203+
self.assertEqual(exp, result)
198204

199205
query = "SHOW GLOBAL STATUS LIKE 'Uptime_since_flush_status'"
200206
pre_flush = int(self.cnx.info_query(query)[1])

tests/test_bugs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
# MySQL Connector/Python - MySQL driver written in Python.
3-
# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
44

55
# MySQL Connector/Python is licensed under the terms of the GPLv2
66
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -62,6 +62,8 @@
6262
ERR_NO_CEXT = "C Extension not available"
6363

6464

65+
@unittest.skipIf(tests.MYSQL_VERSION == (5, 7, 4),
66+
"Bug328998 not tested with MySQL version 5.7.4")
6567
class Bug328998Tests(tests.MySQLConnectorTests):
6668
"""Tests where connection timeout has been set"""
6769

0 commit comments

Comments
 (0)