On Mon, May 23, 2016 at 12:22 PM, Bernd Lehmkuhl <bernd.lehmkuhl at mailbox.org
> wrote:
>
> > Dominique Devienne <ddevienne at gmail.com> hat am 23. Mai 2016 um 11:20
> geschrieben:
> > On Mon, May 23, 2016 at 10:39 AM, Bernd Lehmkuhl <
> bernd.lehmkuhl at mailbox.org
> > > [...] What might cause a "constraint failed" message following
> this command: [...]
> >
> > Which version of SQLite? More recent ones tell you which constraint
> failed,
> > when they are named, which yours are (a good thing IMHO).
>
> Most recent one - 3.12.2. Unfortunately without any name.
> [...]


/*** t_geometrie_index ***/
CREATE VIRTUAL TABLE t_geometrie_index USING rtree(
  id,
[...]

sqlite> INSERT INTO t_geometrie_index (id, xmin, xmax, ymin, ymax)
>    ...> SELECT
>    ...>   t.auto_id, [...]

   ...> FROM
>    ...>   (
>    ...>     SELECT
>    ...>       k.id, [...]
>    ...>     FROM
>    ...>       t_geometrie_knoten k
>    ...>
>    ...>     UNION ALL <<<<<<
>    ...>
>    ...>     SELECT
>    ...>       p.id, [...]
>    ...>     FROM
>    ...>       t_geometrie_punkte p
>    ...>     GROUP BY
>    ...>       p.id
>    ...>   ) sub JOIN t_geometrie_typ t
>    ...>         ON   sub.id = t.id;
> Error: constraint failed
> sqlite> rollback;
> sqlite> .quit
>

OK, was worth a shot. I had a feeling it might be related to the RTREE
vtables.

Never used RTREE myself, in SQLite, although I know what this is.
Could it be your you "knoten" and "punkte" tables have values with the same
IDs?
Try manually adding two rows into t_geometrie_index using for example

  insert into t_geometrie_index values (1, ...), (1, ...)

and see if you get the same error. I'm guessing it might be coming from
this. --DD

PS: 3.13.0 just released I think, so not the latest anymore :)

Reply via email to