Skip to content
Back to formatted view

Raw Message

Message-ID: <m2ve8sppvk.fsf@userprimary.net>
Date: 2007-10-27T14:57:03Z
From: Seth Falcon
Subject: RSQLite segfault after adding column to table
In-Reply-To: <722a2f5e0710261235k3ac1a996y68b7777cba02d235@mail.gmail.com> (Noah Hoffman's message of "Fri\, 26 Oct 2007 12\:35\:00 -0700")

Hi Noah,

"Noah Hoffman" <noah.hoffman at gmail.com> writes:
> I've noticed a segfault caused by attempting to select from a table
> after a column of unspecified type is added. I've only tested this
> using the single R installation described below.
>
> Here's some info about my environment:
>> sessionInfo()
> R version 2.7.0 Under development (unstable) (2007-09-24 r42964)
> x86_64-unknown-linux-gnu
> ...
> other attached packages:
> [1] RSQLite_0.6-0 DBI_0.2-3

Can you try upgrading to RSQLite 0.6-3?

I'm seeing the following:

> library(RSQLite)
Loading required package: DBI
> con <- dbConnect(dbDriver("SQLite"), dbname = ":memory:")
> dbGetQuery(con, "create table s (col1 INTEGER)")
NULL
> dbGetQuery(con, "insert into s (col1) values (1)")
NULL
> dbGetQuery(con, "select * from s")
  col1
1    1
> dbGetQuery(con, "alter table s add column col2")
NULL
> dbGetQuery(con, "select * from s")
  col1 col2
1    1 <NA>
> sessionInfo()
R version 2.6.0 beta (--) 
i386-apple-darwin8.10.1 

locale:
C

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] RSQLite_0.6-3 DBI_0.3-0    

loaded via a namespace (and not attached):
[1] tools_2.6.0

-- 
Seth Falcon | seth at userprimary.net | blog: http://userprimary.net/user/