Package: libsqlite3-0
Version: 3.8.2-1
Severity: normal

Attempting to create a table which has a UNIQUE PRIMARY KEY and is also
WITHOUT ROWID causes an immediate crash.

Rereading the documentation reveals that UNIQUE is in fact redundant to
PRIMARY KEY, so I don't actually need this to work, but regardless it
should not crash.  (sqlite is in general fine with UNIQUE PRIMARY KEY;
it's just the combination of that and WITHOUT ROWID that crashes.)

To reproduce:

$ gdb --args sqlite3 test.db "CREATE TABLE t ( x UNIQUE PRIMARY KEY ) WITHOUT 
ROWID;"
GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/sqlite3...Reading symbols from 
/usr/lib/debug/.build-id/3a/01d762213ac60b3ab2d8d66e8cf1473fbbfe2d.debug...done.
done.
(gdb) r
Starting program: /usr/bin/sqlite3 test.db CREATE\ TABLE\ t\ \(\ x\ UNIQUE\ 
PRIMARY\ KEY\ \)\ WITHOUT\ ROWID\;
warning: no loadable sections found in added symbol-file system-supplied DSO at 
0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
convertToWithoutRowidTable (pTab=0x555555778948, pParse=0x555555776ba8) at 
sqlite3.c:85911
85911   sqlite3.c: No such file or directory.
(gdb) bt
#0  convertToWithoutRowidTable (pTab=0x555555778948, pParse=0x555555776ba8) at 
sqlite3.c:85911
#1  sqlite3EndTable (pParse=pParse@entry=0x555555776ba8, 
pCons=pCons@entry=0x555555776f10, pEnd=pEnd@entry=0x555555776f30, 
tabOpts=<optimized out>, 
    pSelect=pSelect@entry=0x0) at sqlite3.c:20492
#2  0x00007ffff7b87963 in yy_reduce (yyruleno=32, yypParser=0x555555776ba8) at 
sqlite3.c:116504
#3  sqlite3Parser (yyp=yyp@entry=0x555555776e58, yymajor=<optimized out>, 
yyminor=..., pParse=pParse@entry=0x555555776ba8) at sqlite3.c:52191
#4  0x00007ffff7b8b6fc in sqlite3RunParser (pParse=pParse@entry=0x555555776ba8, 
zSql=zSql@entry=0x7fffffffe5e1 "CREATE TABLE t ( x UNIQUE PRIMARY KEY ) WITHOUT 
ROWID;", 
    pzErrMsg=pzErrMsg@entry=0x7fffffffca68) at sqlite3.c:118552
#5  0x00007ffff7b8bd32 in sqlite3Prepare (db=db@entry=0x555555763038, 
zSql=zSql@entry=0x7fffffffe5e1 "CREATE TABLE t ( x UNIQUE PRIMARY KEY ) WITHOUT 
ROWID;", 
    nBytes=nBytes@entry=-1, saveSqlFlag=saveSqlFlag@entry=1, 
pReprepare=pReprepare@entry=0x0, ppStmt=ppStmt@entry=0x7fffffffcb80, 
pzTail=pzTail@entry=0x7fffffffcb88)
    at sqlite3.c:99204
#6  0x00007ffff7b8bfe5 in sqlite3LockAndPrepare (db=0x555555763038, 
zSql=0x7fffffffe5e1 "CREATE TABLE t ( x UNIQUE PRIMARY KEY ) WITHOUT ROWID;", 
nBytes=-1, 
    saveSqlFlag=1, pOld=0x0, ppStmt=0x7fffffffcb80, pzTail=0x7fffffffcb88) at 
sqlite3.c:99296
#7  0x00007ffff7b8c278 in sqlite3_prepare_v2 (db=db@entry=0x555555763038, 
zSql=zSql@entry=0x7fffffffe5e1 "CREATE TABLE t ( x UNIQUE PRIMARY KEY ) WITHOUT 
ROWID;", 
    nBytes=nBytes@entry=-1, ppStmt=ppStmt@entry=0x7fffffffcb80, 
pzTail=pzTail@entry=0x7fffffffcb88) at sqlite3.c:99372
#8  0x0000555555559dd6 in shell_exec (db=0x555555763038, 
zSql=zSql@entry=0x7fffffffe5e1 "CREATE TABLE t ( x UNIQUE PRIMARY KEY ) WITHOUT 
ROWID;", 
    pArg=pArg@entry=0x7fffffffcc80, pzErrMsg=pzErrMsg@entry=0x7fffffffcc78, 
xCallback=0x555555558fe0 <shell_callback>) at ./src/shell.c:1274
#9  0x0000555555556f2e in main (argc=3, argv=0x7fffffffe308) at 
./src/shell.c:3511





-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (501, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.12-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libsqlite3-0 depends on:
ii  libc6              2.17-97
ii  multiarch-support  2.17-97

libsqlite3-0 recommends no packages.

libsqlite3-0 suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to