[sqlite] Possible bug? Primary key not created for CREATE TABLE(id INTEGER primary key);

4 views
Skip to first unread message

Neo Anderson

unread,
Mar 25, 2012, 3:07:13 AM3/25/12
to sqlite...@sqlite.org

See the following result:

sqlite> select * from sqlite_master order by type;
type|name|tbl_name|rootpage|sql
index|sqlite_autoindex_t_1|t|4|
index|sqlite_autoindex_t3_1|t3|7|
table|t|t|2|CREATE TABLE t(id int primary key, key, value)
table|t2|t2|5|CREATE TABLE t2(id INTEGER primary key, key, value)
table|t3|t3|6|CREATE TABLE t3(id not null primary key, key, value)
table|t4|t4|8|CREATE TABLE t4(id INTEGER primary key, key, value)

No indexes created for t2 and t4. Or it is just a illusion?



_______________________________________________
sqlite-users mailing list
sqlite...@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Dan Kennedy

unread,
Mar 25, 2012, 4:22:19 AM3/25/12
to sqlite...@sqlite.org
On 03/25/2012 02:07 PM, Neo Anderson wrote:
>
> See the following result:
>
> sqlite> select * from sqlite_master order by type;
> type|name|tbl_name|rootpage|sql
> index|sqlite_autoindex_t_1|t|4|
> index|sqlite_autoindex_t3_1|t3|7|
> table|t|t|2|CREATE TABLE t(id int primary key, key, value)
> table|t2|t2|5|CREATE TABLE t2(id INTEGER primary key, key, value)
> table|t3|t3|6|CREATE TABLE t3(id not null primary key, key, value)
> table|t4|t4|8|CREATE TABLE t4(id INTEGER primary key, key, value)
>
> No indexes created for t2 and t4. Or it is just a illusion?

INTEGER primary keys are special:

http://sqlite.org/lang_createtable.html#rowid

Reply all
Reply to author
Forward
0 new messages