SQLite

View Ticket
Login
2012-01-28
21:09 Fixed ticket [c04a8b8a]: Trailing comments not stripped from views, invalid dumps plus 2 other changes (artifact: 4d390357 user: drh)
21:08
Update the .dump command of the command-line shell so that it (1) avoids putting the semicolon of a DDL statement on the same line as a comment, (2) avoids long expression, even when dumping a table with many columns, and (3) avoids unnecessary quoting of the table name. This fixes tickets [c04a8b8a4f] and [232637c465]. Shell change only; no changes to the SQLite core. (check-in: e6eea8d5 user: drh tags: trunk)
2012-01-27
18:15 New ticket [c04a8b8a] Trailing comments not stripped from views, invalid dumps. (artifact: a35724eb user: rogerb)

Ticket Hash: c04a8b8a4f0c154cfdbd8a4a3086d04c7ed04027
Title: Trailing comments not stripped from views, invalid dumps
Status: Fixed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2012-01-28 21:09:09
Version Found In: 3.7.10
Description:
Reported on the mailing list. When making a dump the SQL text from sqlite_master is taken as is and a semi-colon appended. For tables, triggers and indexes SQLite strips trailing comments before putting their text into sqlite_master. However this is not done for views. Consequently the view text can end up like:
create view ......   -- a comment

When this is dumped the trailing comment swallows any semicolon appended.

Mailing list thread: http://thread.gmane.org/gmane.comp.db.sqlite.general/71502