Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2871)

Issue 9750: sqlite3 iterdump fails on column with reserved name

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 months, 2 weeks ago by marko.kohtala
Modified:
3 months, 2 weeks ago
Reviewers:
CC:
gh_ghaering.de, eric.araujo, Marko.Kohtala, devnull_psf.upfronthosting.co.za, Petri Lehtinen, xapple, devnull_psf.upfronthosting.co.za
Visibility:
Public.

Patch Set 1 #

Total comments: 2

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/sqlite3/dump.py View 2 chunks +28 lines, -22 lines 0 comments Download
Lib/sqlite3/test/dump.py View 1 1 chunk +8 lines, -0 lines 0 comments Download
Misc/ACKS View 1 chunk +1 line, -0 lines 0 comments Download
Misc/NEWS View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 1
Marko.Kohtala
6 months, 2 weeks ago #1
Thank you for continuing on the patch.

Here are some review comments for you.

http://bugs.python.org/review/9750/diff/3609/11286
File Lib/sqlite3/dump.py (right):

http://bugs.python.org/review/9750/diff/3609/11286#newcode43
Lib/sqlite3/dump.py:43: res = cu.execute("PRAGMA table_info('%s')" %
table_name.replace('"', '""'))
Table names with a quote (') will not work. Also, a table name with a double
quote will end up having two double quotes in it. The enclosing quote and the
duplicated quote must match!

Single quotes around the pragma table_info table name work, but since this is an
identifier, use double quotes. Single quotes are for string literals. See
http://www.sqlite.org/lang_keywords.html.

res = cu.execute("""PRAGMA table_info("%s")""" % table_name.replace('"', '"" '))

http://bugs.python.org/review/9750/diff/3609/11287
File Lib/sqlite3/test/dump.py (right):

http://bugs.python.org/review/9750/diff/3609/11287#newcode30
Lib/sqlite3/test/dump.py:30: """CREATE TABLE t4('legal""name' text);"""
Quote names using double quotes. The column name now has two double quotes, but
you most likely intended it to have one.

Also you are missing the test case for a table with double quote in its name.

Please use
CREATE TABLE t3("group" text, "index" integer);
CREATE TABLE "t""4"("legal""name" text);
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld