Megatest

View Ticket
Login
Ticket Hash: 6e26106a1c2c10669e9c74748a6067309df48474
Title: megatest -import-megatest.db fails on read-only database.
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2019-07-17 12:26:46
Version Found In: v1.6530
Description:
From another user on a read-only database:

plxck3045> megatest -import-megatest.db 
INFO: (0) Records count before clean: 505131

Error: with-transaction: uncaught exception: #f

Error: (step!) attempt to write a readonly database: #<sqlite3:statement sql="DELETE FROM tests WHERE run_id in (SELECT id FROM runs WHERE state='deleted') and last_update < 1560809468.0;">

        Call history:

        db.scm:1758: sqlite3#prepare      
        db.scm:1757: g3151        
        db.scm:1758: sqlite3#prepare      
        db.scm:1757: g3151        
        db.scm:1758: sqlite3#prepare      
        db.scm:1757: g3151        
        db.scm:1758: sqlite3#prepare      
        db.scm:1757: g3151        
        db.scm:1758: sqlite3#prepare      
        db.scm:1780: sqlite3#with-transaction     
        db.scm:1783: sqlite3#for-each-row         
        db.scm:1784: debug:print-info     
        common_records.scm:235: debug:debug-mode          
        common_records.scm:236: port?     
        common_records.scm:236: with-output-to-port       
        db.scm:1786: g3179              <--
User Comments:
mmgraham added on 2019-07-15 21:45:29: (text/x-fossil-plain)
I found that the 'dejunk option to db:multi-db-sync caused the operation to fail. If I comment out 'dejunk, it works. Perhaps disable -dejunk on read-only source dbs?

mmgraham added on 2019-07-17 17:51:01: (text/x-fossil-plain)
In dejunk cleanup, I changed it to call db:clean-up on megatest.db only if it's writable. Checked this into v1.65 branch.