Discussion:
[sqlite] Problem with sqldiff
John G
2015-11-07 16:23:35 UTC
Permalink
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
Richard Hipp
2015-11-07 18:37:03 UTC
Permalink
Post by John G
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
***@sqlite.org
John G
2015-11-08 10:25:03 UTC
Permalink
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;
Post by Richard Hipp
Post by John G
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
_______________________________________________
sqlite-users mailing list
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...