FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-39652: returning entire sqlite column names by eLRuLL · Pull Request #18533 · python/cpython · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .py  (3) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions Doc/includes/sqlite3/pysqlite_datetime.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
row = cur.fetchone()
print("current_date", row[0], type(row[0]))
print("current_timestamp", row[1], type(row[1]))
print(cur.description)

con.close()
2 changes: 1 addition & 1 deletion Lib/sqlite3/test/regression.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def CheckStatementReset(self):
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")
Expand Down
2 changes: 1 addition & 1 deletion Lib/sqlite3/test/types.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def CheckColName(self):

# Check if the stripping of colnames works. Everything after the first
# whitespace should be stripped.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This comment is now outdated 🙂

self.assertEqual(self.cur.description[0][0], "x")
self.assertEqual(self.cur.description[0][0], "x [bar]")

def CheckCaseInConverterName(self):
self.cur.execute("select 'other' as \"x [b1b1]\"")
Expand Down
5 changes: 1 addition & 4 deletions Modules/_sqlite/cursor.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,7 @@ _pysqlite_build_column_name(const char* colname)
}

for (pos = colname;; pos++) {
if (*pos == 0 || *pos == '[') {
if ((*pos == '[') && (pos > colname) && (*(pos-1) == ' ')) {
pos--;
}
if (*pos == '\0') {
return PyUnicode_FromStringAndSize(colname, pos - colname);
}
}
Expand Down

Back | FazBrowse Home | New Git URL