Skip to content

Commit 0d7d6aa

Browse files
author
Geert Vanderkelen
committed
Merge branch 'feature-WL7643' into develop
2 parents 69ad265 + a190483 commit 0d7d6aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+11009
-1907
lines changed

CHANGES.txt

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
====================================================
2-
MySQL Connector/Python 2.0 - Release Notes & Changes
2+
MySQL Connector/Python 2.1 - Release Notes & Changes
33
====================================================
44

55
MySQL Connector/Python
@@ -8,37 +8,8 @@ Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
88
Full release notes:
99
http://dev.mysql.com/doc/relnotes/connector-python/en/
1010

11-
v2.0.1
12-
======
11+
v2.1.1a
12+
=======
1313

14-
- WL7954: Add support for RANGE_STRING Fabric sharding type
15-
- WL7955: Add support for RANGE_DATETIME Fabric sharding type
16-
- BUG19440592: Fix exception not captured when SSL is unavailable
17-
- BUG19481761: Fix option files with !include with trailing newline
18-
- BUG18798953: Add MySQLConnection.shutdown() to abruply close connection
19-
- BUG19168737: Fix unsupported connection argument error with option files
20-
- BUG19282158: Fix NULL values to work with prepared statements
21-
- BUG19179711: Fix using '%s' in django backend
22-
- BUG19169143: Fix raising error with duplicate option files
23-
- BUG19170287: Fix duplicate section error with Python v3
24-
- BUG19163169: Add support for Django 1.7
25-
- BUG19225481: Fix floating point inaccuracy with Python v2
26-
- BUG19164627: Fix cursor trying to decode linestring data as utf-8
27-
28-
29-
v2.0.0a1
30-
========
31-
32-
- BUG19207922: Fix fetching multiple results when executing procedure
33-
- BUG19184025: Fix results containing NULL
34-
- BUG19169990: Fix sending/receiving using compressed connection
35-
- BUG18956789: Fix Django TimeField 00:00:00 converting to MySQL NULL
36-
- WL7228: Allow Connector/Python to use MySQL option files
37-
- BUG18843153: Fix Django to check connection on each request
38-
- WL7937: Allow LOAD DATA LOCAL INFILE by default
39-
- BUG18742429: Fix prepared statements returning lots of columns
40-
- BUG18814880: Fix stopping mysqld running unit tests on Windows
41-
- WL7292: Add cursors returning dict and namedtuple as rows
42-
- WL7462: Consolidate Python v2 and v3 code
43-
- WL7716: Move commercial files and distribution to CPYINT
14+
- WL7643: Add Python C Extension using Connector/C
4415

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ include MANIFEST.in
99
recursive-include examples *.py
1010
recursive-include lib *.py
1111
recursive-include tests *.py *.csv *.pem *.cnf
12+
recursive-include src *.c *.h
1213

1314
include docs/README_DOCS.txt
1415

cpyint

examples/microseconds.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
with millisecond precision.
3737
"""
3838

39-
from datetime import time
39+
from datetime import time, datetime
4040

4141
import mysql.connector
4242

@@ -45,6 +45,7 @@
4545
"teamid TINYINT UNSIGNED NOT NULL, "
4646
"swimmer TINYINT UNSIGNED NOT NULL, "
4747
"lap TIME(3), "
48+
"start_shot DATETIME(6), "
4849
"PRIMARY KEY (teamid, swimmer)"
4950
") ENGINE=InnoDB"
5051
)
@@ -68,24 +69,29 @@ def main(config):
6869

6970
teams = {}
7071
teams[1] = [
71-
(1, time(second=47, microsecond=510000)),
72-
(2, time(second=47, microsecond=20000)),
73-
(3, time(second=47, microsecond=650000)),
74-
(4, time(second=46, microsecond=60000)),
72+
(1, time(second=47, microsecond=510000),
73+
datetime(2009, 6, 7, 9, 15, 2, 234)),
74+
(2, time(second=47, microsecond=20000),
75+
datetime(2009, 6, 7, 9, 30, 5, 102345)),
76+
(3, time(second=47, microsecond=650000),
77+
datetime(2009, 6, 7, 9, 50, 23, 2300)),
78+
(4, time(second=46, microsecond=60000),
79+
datetime(2009, 6, 7, 10, 30, 56, 1)),
7580
]
7681

77-
insert = "INSERT INTO relay_laps (teamid,swimmer,lap) VALUES (%s,%s,%s)"
82+
insert = ("INSERT INTO relay_laps (teamid, swimmer, lap, start_shot) "
83+
"VALUES (%s, %s, %s, %s)")
7884
for team, swimmers in teams.items():
7985
for swimmer in swimmers:
80-
cursor.execute(insert, (team, swimmer[0], swimmer[1]))
86+
cursor.execute(insert, (team, swimmer[0], swimmer[1], swimmer[2]))
8187
cnx.commit()
8288

8389
cursor.execute("SELECT * FROM relay_laps")
8490
for row in cursor:
85-
output.append("{0: 2d} | {1: 2d} | {2}".format(*row))
91+
output.append("{0: 2d} | {1: 2d} | {2} | {3}".format(*row))
8692

8793
try:
88-
cursor.execute("DROP TABLE IF EXISTS relay_laps")
94+
cursor.execute("DROP TABLE IF EXISTS relay_lapss")
8995
except:
9096
# Ignoring the fact that it was not there
9197
pass

examples/warnings.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ def main(config):
6464
#
6565
# Configure MySQL login and database to use in config.py
6666
#
67-
import config
68-
config = config.Config.dbinfo().copy()
67+
config = {
68+
'host': 'localhost',
69+
'port': 3306,
70+
'database': 'test',
71+
'user': 'root',
72+
'password': '',
73+
'charset': 'utf8',
74+
'use_unicode': True,
75+
'get_warnings': True,
76+
}
77+
6978
out = main(config)
7079
print('\n'.join(out))

0 commit comments

Comments
 (0)