bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942)

This commit is contained in:
Serhiy Storchaka 2020-03-21 15:53:28 +02:00 committed by GitHub
parent 684d2b9a07
commit b146568dfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 14 deletions

View file

@ -68,7 +68,7 @@ class RegressionTests(unittest.TestCase):
def CheckColumnNameWithSpaces(self):
cur = self.con.cursor()
cur.execute('select 1 as "foo bar [datetime]"')
self.assertEqual(cur.description[0][0], "foo bar")
self.assertEqual(cur.description[0][0], "foo bar [datetime]")
cur.execute('select 1 as "foo baz"')
self.assertEqual(cur.description[0][0], "foo baz")