BUG: whitespace in schemas?!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

BUG: whitespace in schemas?!

積丹尼 Dan Jacobson
You really should standardize how the schemas are stored. Differing whitespace
should not be significant and stored in this case:

file epiphany/cookies.sqlite midori/cookies.db
epiphany/cookies.sqlite: SQLite 3.x database, last written using SQLite version 3019003
midori/cookies.db:       SQLite 3.x database, last written using SQLite version 3019003
for i in midori/cookies.db epiphany/cookies.sqlite; do sqlite3 $i .schema; done
CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);
CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT, expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);

They differ only by
"path TEXT,expiry INTEGER" vs.
"path TEXT, expiry INTEGER".

This tells me that sqlite3 is storing schemas in some inefficient wrong way!
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BUG: whitespace in schemas?!

Simon Slavin-3


On 2 Jul 2017, at 12:15am, 積丹尼 Dan Jacobson <[hidden email]> wrote:

> This tells me that sqlite3 is storing schemas in some inefficient wrong way!

SQLite stores the statements needed to create the schema.  For example, the structure of a table is not stored in any structured way, instead the "CREATE TABLE" command is stored.  When you use an "ALTER TABLE" command, SQLite parses and modifies the "CREATE TABLE" command to fake a new one representing the new structure.

This means that major changes can be made to how SQLite works internally without needing to revise the file format, which has remained almost unchanged since 2004.  This is incredibly useful to SQLite’s users who can use completely up-to-date tools to manipulate ancient databases.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...