Problem with sqldiff

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with sqldiff

John Gillespie-2
I saw sqldiff mentioned and decided to try it (compiled from
sqlite-src-3090200) and got an SQL error.

./sqldiff: SQL statement error: near "1": syntax error
"SELECT B.rowid, 1, -- changed row
       A.id IS NOT B.id, B.id,
       A."desc" IS NOT B."desc", B."desc"
  FROM main.A A, aux.A B
 WHERE A.rowid=B.rowid
   AND (A.id IS NOT B.id
        OR A."desc" IS NOT B."desc")
 UNION ALL
SELECT A.rowid, 2, -- deleted row
       NULL, NULL,
       NULL, NULL
  FROM main.A A
 WHERE NOT EXISTS(SELECT 1 FROM aux.A B
                   WHERE A.rowid=B.rowid)
 UNION ALL
SELECT B.rowid, 3, -- inserted row
       1, B.id,
       1, B."desc"                                <========= no comma
       1, B.,                                        <====== extra null
column
  FROM aux.A B
 WHERE NOT EXISTS(SELECT 1 FROM main.A A
                   WHERE A.rowid=B.rowid)
 ORDER BY 1;
"

This occurred on a table to which I had added a column.
The erroneous part is obvious marked.

Is it a conflict between my command-line ( v3.8.8 ) and sqldiff (v3.9.2)?
Is this a bug?
if not, any suggestions?

Here is is the SQL to set up both databases :


sqlite-src-3090200 545 % sqlite3 z1.db
SQLite version 3.8.8.3 2015-02-25 13:29:11
Enter ".help" for usage hints.
sqlite> create table A (id integer, desc text);
sqlite> insert into A values (1,'aaaa') , (2,'bbbb'), (3,'cccc');
sqlite> select * from A;
1|aaaa
2|bbbb
3|cccc
sqlite> .exit

sqlite-src-3090200 546 % sqlite3 z2.db
SQLite version 3.8.8.3 2015-02-25 13:29:11
Enter ".help" for usage hints.
sqlite> create table A (id integer, desc text);
sqlite> insert into A values (1,'aaaa') , (2,'bbbb'), (3,'cccc');
sqlite> alter table A add category text;
sqlite> update A set category='dddd';
sqlite> select * from A;
1|aaaa|dddd
2|bbbb|dddd
3|cccc|dddd
sqlite> .exit


Great database - ergo great development team!

John Gillespie
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with sqldiff

Richard Hipp-3
On 11/7/15, John G <[hidden email]> wrote:
> I saw sqldiff mentioned and decided to try it (compiled from
> sqlite-src-3090200) and got an SQL error.
>

Please try the latest trunk version
(https://www.sqlite.org/src/artifact/37ab2cd4f0c8b4f0) and let us know
if that fails to solve your problem.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with sqldiff

John Gillespie-2
Richard
Thanks. That gives me what I would expect.

John Gillespie

sqlite-src-30902T 573 % ./sqldiff z1.db z2.db
ALTER TABLE A ADD COLUMN category;
UPDATE A SET category='dddd' WHERE rowid=1;
UPDATE A SET category='dddd' WHERE rowid=2;
UPDATE A SET category='dddd' WHERE rowid=3;

On 7 November 2015 at 18:37, Richard Hipp <[hidden email]> wrote:

> On 11/7/15, John G <[hidden email]> wrote:
> > I saw sqldiff mentioned and decided to try it (compiled from
> > sqlite-src-3090200) and got an SQL error.
> >
>
> Please try the latest trunk version
> (https://www.sqlite.org/src/artifact/37ab2cd4f0c8b4f0) and let us know
> if that fails to solve your problem.
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users