[sqlite] Bug report: USBAN failure

2014-12-02 Thread Hadley Wickham
Hi, I'm the maintainer of RSQLite, the R language binding for SQLite. Recently, CRAN (the common R archive network) has started running all R packages with USBAN. This reveals a problem in sqlite.c (http://www.stats.ox.ac.uk/pub/bdr/memtests/UBSAN-gcc/RSQLite/tests/testthat.Rout) >

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Richard Hipp
On Mon, Dec 1, 2014 at 5:46 PM, Hadley Wickham wrote: > Hi, > > I'm the maintainer of RSQLite, the R language binding for SQLite. > Recently, CRAN (the common R archive network) has started running all > R packages with USBAN. This reveals a problem in sqlite.c > ( >

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Dominique Devienne
On Tue, Dec 2, 2014 at 2:47 PM, Richard Hipp wrote: > On Mon, Dec 1, 2014 at 5:46 PM, Hadley Wickham > wrote: > > [...] has started running all R packages with USBAN. This reveals a > problem in sqlite.c > > I'm not sure what USBAN is > Most likely a typo.

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Clemens Ladisch
Richard Hipp wrote: > But apparently there is an issue in USBAN in that it does not allow calls > to memcpy() and memset() with NULL pointers even it the count field (the > third parameter) is zero. I couldn't find anything in the memcpy() or > memset() documentation that disallowed this case.

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Richard Hipp
On Tue, Dec 2, 2014 at 8:53 AM, Dominique Devienne wrote: > On Tue, Dec 2, 2014 at 2:47 PM, Richard Hipp wrote: > > > On Mon, Dec 1, 2014 at 5:46 PM, Hadley Wickham > > wrote: > > > [...] has started running all R packages with USBAN.

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Abramo Bagnara
Il 02/12/2014 15:02, Richard Hipp ha scritto: > On Tue, Dec 2, 2014 at 8:53 AM, Dominique Devienne > wrote: > >> On Tue, Dec 2, 2014 at 2:47 PM, Richard Hipp wrote: >> >>> On Mon, Dec 1, 2014 at 5:46 PM, Hadley Wickham >>> wrote:

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Hadley Wickham
>> The block of code that refers to is: >> >> if( p->azVar ){ >> p->nzVar = pParse->nzVar; >> memcpy(p->azVar, pParse->azVar, p->nzVar*sizeof(p->azVar[0])); >> memset(pParse->azVar, 0, pParse->nzVar*sizeof(pParse->azVar[0])); >> } >> >> So maybe the check should be on

[sqlite] appending the output of a query

2014-12-02 Thread Paul Sanderson
I have a query that returns one column but a number of rows so for instance SELECT name from tab might return a b c d I would like to append these terms and get a single line/string a_b_c_d I want to just use a single SQL query to do this, is it possible? Paul

Re: [sqlite] appending the output of a query

2014-12-02 Thread Richard Hipp
On Tue, Dec 2, 2014 at 12:46 PM, Paul Sanderson < sandersonforens...@gmail.com> wrote: > I have a query that returns one column but a number of rows so for instance > > SELECT name from tab > > might return > > a > b > c > d > > I would like to append these terms and get a single line/string > >

Re: [sqlite] appending the output of a query

2014-12-02 Thread John McKown
On Tue, Dec 2, 2014 at 11:51 AM, Richard Hipp wrote: > On Tue, Dec 2, 2014 at 12:46 PM, Paul Sanderson < > sandersonforens...@gmail.com> wrote: > > > I have a query that returns one column but a number of rows so for > instance > > > > SELECT name from tab > > > > might return >

Re: [sqlite] appending the output of a query

2014-12-02 Thread Paul Sanderson
Thanks Richard That helps but it seems I over simplified in order to get the help I thought I needed :) My actual query follows a MFT entry from an NTFS file system as such WITH RECURSIVE rcte AS (SELECT rtable.ID, rtable.parent, rtable.FileName FROM rtable WHERE rtable.ID =

Re: [sqlite] appending the output of a query

2014-12-02 Thread Igor Tandetnik
On 12/2/2014 1:47 PM, Paul Sanderson wrote: WITH RECURSIVE rcte AS (SELECT rtable.ID, rtable.parent, rtable.FileName FROM rtable WHERE rtable.ID = 510 UNION ALL SELECT rtable.ID, rtable.parent, rtable.FileName FROM rcte INNER JOIN

Re: [sqlite] appending the output of a query

2014-12-02 Thread Paul Sanderson
Hm thanks - actually thinking about it sorting by ID doesn't work as it is quite likely that the folder order doesn't follow the id/parent order, i.e. a parent folder could have an ID greater than one or more of its children. So what I really need is to a) ensure that the ordering of the

Re: [sqlite] appending the output of a query

2014-12-02 Thread Igor Tandetnik
On 12/2/2014 2:46 PM, Paul Sanderson wrote: So what I really need is to a) ensure that the ordering of the recursive query is guranteed, i.e. the order follows the ID/parent relationship to the root b) a method of concatenating this in reverse order WITH RECURSIVE rcte AS ( SELECT 0 as

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread James K. Lowden
On Tue, 02 Dec 2014 15:58:47 +0100 Abramo Bagnara wrote: > The point is not about overzealousness, but about the declaration of > memcpy/memset on your machine. > > If it contains the nonnull attribute then (correctly) UBSan detect > that such constraint is not

Re: [sqlite] Bug report: USBAN failure

2014-12-02 Thread Clemens Ladisch
James K. Lowden wrote: > /* Copy N bytes of SRC to DEST. */ > extern void *memcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > __THROW __nonnull ((1, 2)); > > IIUC the declaration specifies the pointer cannot be NULL and the > compiler