Greetings!
 
In short: sqldiff unable to formulate correct `sql` to convert slave.db into 
host.db.
 
$ sqldiff slave.db host.db 
UPDATE balancelog SET total=1500.74122892 WHERE id=1418;
$ echo "UPDATE balancelog SET total=1500.74122892 WHERE id=1418;" | sqlite3 
slave.db
$ sqldiff slave.db host.db 
UPDATE balancelog SET total=1500.74122892 WHERE id=1418;
 
 
 
The reason is in `real`. In host.db — `real` `total` was generated by TRIGGER.
And precision is - 16 numbers after comma. But sqldiff shows only 8 numbers. 
It’s round 19 to 20 in this edge #8-#9 numbers, and `UPDATE` failed, because 
difference still exist.
 
More deep:
That is how is looking host.db in mid-night-commander via F3:
PRAGMA foreign_keys=OFF;                                                        
                                                                                
                                                                                
                                  
BEGIN TRANSACTION;                                                              
                                                                                
                                                                                
                                  
CREATE TABLE IF NOT EXISTS "balancelog" ( id integer primary key, timestamp 
int, coin text, total real );                                                   
                                                                                
                                      
INSERT INTO balancelog VALUES(1418,1578700800,'WAVES',1500.7412289200001395);   
                                                                                
                                                                                
                                  
COMMIT;
 
 
But slave.db:
PRAGMA foreign_keys=OFF;                                                        
                                                                                
                                                                                
                                  
BEGIN TRANSACTION;                                                              
                                                                                
                                                                                
                                  
CREATE TABLE IF NOT EXISTS "balancelog" ( id integer primary key, timestamp 
int, coin text, total real );                                                   
                                                                                
                                      
INSERT INTO balancelog VALUES(1418,1578700800,'WAVES',1500.7412289199999122);   
                                                                                
                                                                                
                                  
COMMIT;
 
host:  1500.7412289200001395
slave: 1500.7412289199999122
 
That is it. slave.db and host.db in attach. see.
 
System: Debian sid
ii  sqlite3        3.30.1-1     amd64        Command line interface for SQLite 3
$ sqlite3 -version
3.30.1 2019-10-10 20:19:45 
18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3dfalt1
 
 
--
forceps millenium
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to