mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
* Fix pytimes.TimeDelta_or_None()
* Include days with mxdatetime.format_TIME() * Return MySQL TIME columns as a time delta * Remove old CompatMysqldb module * Version 1.1.6
This commit is contained in:
@ -18,7 +18,7 @@ __revision__ = """$Revision$"""[11:-2]
|
||||
version_info = (
|
||||
1,
|
||||
1,
|
||||
5,
|
||||
6,
|
||||
"final",
|
||||
1)
|
||||
if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3]
|
||||
|
@ -125,7 +125,7 @@ conversions = {
|
||||
FIELD_TYPE.SET: Str2Set,
|
||||
FIELD_TYPE.TIMESTAMP: mysql_timestamp_converter,
|
||||
FIELD_TYPE.DATETIME: DateTime_or_None,
|
||||
FIELD_TYPE.TIME: Time_or_None,
|
||||
FIELD_TYPE.TIME: TimeDelta_or_None,
|
||||
FIELD_TYPE.DATE: Date_or_None,
|
||||
FIELD_TYPE.BLOB: [
|
||||
(FLAG.BINARY, char_array),
|
||||
|
@ -29,7 +29,7 @@ def format_DATE(d):
|
||||
|
||||
def format_TIME(d):
|
||||
"""Format a DateTime object as a time value."""
|
||||
return d.strftime("%H:%M:%S")
|
||||
return d.strftime("%d %H:%M:%S")
|
||||
|
||||
def format_TIMESTAMP(d):
|
||||
"""Format a DateTime object as an ISO timestamp."""
|
||||
|
@ -50,7 +50,7 @@ def TimeDelta_or_None(s):
|
||||
try:
|
||||
h, m, s = s.split(':')
|
||||
td = timedelta(hours=int(h), minutes=int(m), seconds=int(s),
|
||||
microseconds=int(modf(float(s)[0]))*1000000)
|
||||
microseconds=int(modf(float(s))[0])*1000000)
|
||||
if h < 0:
|
||||
return -td
|
||||
else:
|
||||
|
@ -1,5 +1,5 @@
|
||||
#define version_info "(1,1,5,'final',1)"
|
||||
#define __version__ "1.1.5"
|
||||
#define version_info "(1,1,6,'final',1)"
|
||||
#define __version__ "1.1.6"
|
||||
/*
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -427,8 +427,10 @@ _mysql_ConnectionObject_Initialize(
|
||||
PyObject *conv = NULL;
|
||||
PyObject *ssl = NULL;
|
||||
PyObject *value = NULL;
|
||||
#if HAVE_OPENSSL
|
||||
char *key = NULL, *cert = NULL, *ca = NULL,
|
||||
*capath = NULL, *cipher = NULL;
|
||||
#endif
|
||||
char *host = NULL, *user = NULL, *passwd = NULL,
|
||||
*db = NULL, *unix_socket = NULL;
|
||||
uint port = MYSQL_PORT;
|
||||
|
@ -18,7 +18,7 @@ embedded_server = (mysqlclient == 'mysqld')
|
||||
name = "MySQL-%s" % os.path.basename(sys.executable)
|
||||
if embedded_server:
|
||||
name = name + "-embedded"
|
||||
version = "1.1.5"
|
||||
version = "1.1.6"
|
||||
|
||||
# include files and library locations should cover most platforms
|
||||
include_dirs = [
|
||||
@ -120,7 +120,7 @@ setup (# Distribution meta-data
|
||||
|
||||
# Description of the modules and packages in the distribution
|
||||
|
||||
py_modules = ["CompatMysqldb",
|
||||
py_modules = [
|
||||
"_mysql_exceptions",
|
||||
"MySQLdb.converters",
|
||||
"MySQLdb.connections",
|
||||
|
Reference in New Issue
Block a user