mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
Reverted patch #1387290. It caused char/varchar columns with a binary
collation to return array('c', ...), which should only be returned for actual BLOB columns. Figured out how to fix loading SET columns. Bug #1214916. Cleaned up the SET test. Removed *.html and *.css files from MANIFEST; their presence (or lack thereof since they are no longer being packaged) caused RPM builds to fail, and possibly others.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
prune CVS
|
prune CVS
|
||||||
recursive-include doc *.txt *.html *.css
|
recursive-include doc *.txt
|
||||||
include MANIFEST.in
|
include MANIFEST.in
|
||||||
include MANIFEST
|
include MANIFEST
|
||||||
include ChangeLog
|
include ChangeLog
|
||||||
|
@ -42,7 +42,7 @@ import array
|
|||||||
def Bool2Str(s, d): return str(int(s))
|
def Bool2Str(s, d): return str(int(s))
|
||||||
|
|
||||||
def Str2Set(s):
|
def Str2Set(s):
|
||||||
return Set(s.split(','))
|
return Set([ i for i in s.split(',') if i ])
|
||||||
|
|
||||||
def Set2Str(s, d):
|
def Set2Str(s, d):
|
||||||
return string_literal(','.join(s), d)
|
return string_literal(','.join(s), d)
|
||||||
@ -147,11 +147,11 @@ conversions = {
|
|||||||
(None, None),
|
(None, None),
|
||||||
],
|
],
|
||||||
FIELD_TYPE.STRING: [
|
FIELD_TYPE.STRING: [
|
||||||
(FLAG.BINARY, char_array),
|
(FLAG.SET, Str2Set),
|
||||||
(None, None),
|
(None, None),
|
||||||
],
|
],
|
||||||
FIELD_TYPE.VAR_STRING: [
|
FIELD_TYPE.VAR_STRING: [
|
||||||
(FLAG.BINARY, char_array),
|
(FLAG.SET, Str2Set),
|
||||||
(None, None),
|
(None, None),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ class test_MySQLdb(test_capabilities.DatabaseTest):
|
|||||||
generator)
|
generator)
|
||||||
|
|
||||||
def test_SET(self):
|
def test_SET(self):
|
||||||
if True: return
|
|
||||||
things = 'ash birch cedar larch pine'.split()
|
things = 'ash birch cedar larch pine'.split()
|
||||||
def generator(row, col):
|
def generator(row, col):
|
||||||
from sets import Set
|
from sets import Set
|
||||||
@ -46,7 +45,6 @@ class test_MySQLdb(test_capabilities.DatabaseTest):
|
|||||||
if (row >> i) & 1:
|
if (row >> i) & 1:
|
||||||
s.add(things[i])
|
s.add(things[i])
|
||||||
return s
|
return s
|
||||||
self.debug = True
|
|
||||||
self.check_data_integrity(
|
self.check_data_integrity(
|
||||||
('col1 SET(%s)' % ','.join(["'%s'" % t for t in things]),),
|
('col1 SET(%s)' % ','.join(["'%s'" % t for t in things]),),
|
||||||
generator)
|
generator)
|
||||||
|
Reference in New Issue
Block a user