Re: [sqlite] [EXTERNAL] Re: Inconsistent behavior in sqlite3_set_authorizer() and error messages

2019-02-20 Thread Hick Gunter
I take it that this is a side effect of how the parser works: Given the sequence 'CREATE TEMP TABLE X ...', the parser knows that the required action is SQLITE_CREATE_TEMP_TABLE during prepare of the statement as soon as the token TABLE is accepted. OTOH, given the sequence 'CREATE TABLE

Re: [sqlite] Bug Report

2019-02-20 Thread Richard Hipp
On 2/20/19, William ESCANDE wrote: > Hi everyone ! > > TL;DR: > with sanitizer > in func columnName (l.82210) > calling xFunc(l.82235) trigger a cfi_check (and then ABORT) > > Fix to do : > change prototype of sqlite3_value_text to let him return a `void *` There are millions and millions of

Re: [sqlite] What is the recommended way to write to views?

2019-02-20 Thread Keith Medcalf
The insert sequence does not work in all cases. This fixes one particular problem of duplicate or changed linkage to parent in Alpha:Charlie ... create trigger trg_summary_insert instead of insert on summary for each row begin insert or ignore into Alpha (a_attribute) values

[sqlite] Bug Report

2019-02-20 Thread William ESCANDE
Hi everyone ! TL;DR: with sanitizer in func columnName (l.82210) calling xFunc(l.82235) trigger a cfi_check (and then ABORT) Fix to do : change prototype of sqlite3_value_text to let him return a `void *` FULL Description: I am using sqlite3.c in android system (not in NDK). I compile android

Re: [sqlite] What is the recommended way to write to views?

2019-02-20 Thread Keith Medcalf
Or as a trigger of course: create table Alpha ( id integer primary key, a_attribute text not null collate nocase unique ); create table Beta ( id integer primary key, b_attribute text not null collate nocase unique ); create table Charlie ( id integer primary

Re: [sqlite] What is the recommended way to write to views?

2019-02-20 Thread Keith Medcalf
Your constraints are logically inconsistent and incompletely specified. >Alpha has-many Beta,and >Beta has-many Alpha >Alpha has-many Charlie, while >Charlie has one Alpha Implies that: Alpha:Beta is N:M and Beta:Alpha is N:M. Fine. but you did not say whether the instant relationships are

Re: [sqlite] What is the recommended way to write to views?

2019-02-20 Thread David Raymond
Well, you _can_ with this specific simplified schema, but it's a little sketchy and most likely will not scale. So if at all possible this sort of thing should be done from the controlling program rather than by a trigger. Also as mentioned, if the a/b/c _attribute fields aren't unique in the

Re: [sqlite] sqlite segfault on INNER JOIN ON (...) + WHERE field IN (list, of, items)

2019-02-20 Thread Richard Hipp
On 2/19/19, Richard Hipp wrote: > > I have checked in a fix on trunk > (https://www.sqlite.org/src/info/b5f90bfe6295ab3a) but the ticket > (https://www.sqlite.org/src/info/df46dfb631f75694) has been kept open > pending further testing and analysis. Further testing and analysis lead to a better

Re: [sqlite] What is the recommended way to write to views?

2019-02-20 Thread Simon Slavin
On 20 Feb 2019, at 11:14am, Rocky Ji wrote: > create view summary > as >select >a.a_attribute, >b.b_attribute, >c.c_attribute >from >m2mAlphaBeta m >inner join Alpha a on a.a_id = m.FK_a_id >inner join Beta b on b.b_id = m.FK_b_id >

Re: [sqlite] What is the recommended way to write to views?

2019-02-20 Thread Andy Bennett
Hi, Like how do I get ROWID of the "just inserted" record in A to insert into C properly. I am thinking "should I make transactions, but we don't have variables"... and going round-and-round without solution. Is last_insert_rowid what you're looking for?

[sqlite] What is the recommended way to write to views?

2019-02-20 Thread Rocky Ji
Hi everyone, I know the simple answer to be `instead of insert ...`. But consider a situation where: Alpha has-many Beta,and Beta has-many Alpha Alpha has-many Charlie, while Charlie has one Alpha So if my SQL looks like: -- PRAGMA fk ON; create table Alpha ( a_id integer primary key