svn cleanup: sqlite: database disk image is malformed

前端 未结 17 1440
谎友^
谎友^ 2020-12-02 06:31

I was trying to do a svn cleanup because I can\'t commit the changes in my working copy, and I got the following error:

sqllite: databas

相关标签:
17条回答
  • 2020-12-02 06:49

    During app development I found that the messages come from the frequent and massive INSERT and UPDATE operations. Make sure to INSERT and UPDATE multiple rows or data in one single operation.

    var updateStatementString : String! = ""
    
    for item in cardids {
    
    let newstring = "UPDATE "+TABLE_NAME+" SET pendingImages = '\(pendingImage)\' WHERE cardId = '\(item)\';"
                updateStatementString.append(newstring)
    
            }
    
    
            print(updateStatementString)
            let results = dbManager.sharedInstance.update(updateStatementString: updateStatementString)
    
            return Int64(results)
    
    0 讨论(0)
  • 2020-12-02 06:51

    The SVN cleanup didn't work. The SVN folder on my local system got corrupted. So I just deleted the folder, recreated a new one, and updated from SVN. That solved the problem!

    0 讨论(0)
  • 2020-12-02 06:54

    First, open command/terminal at repository root (folder which has .svn as child folder):

    cd /path/to/repository
    

    Download sqlite3 and put executable sqlite3 at root of folder.

    You do an integrity check on the sqlite database that keeps track of the repository (/path/to/repository/.svn/wc.db):

    sqlite3 .svn/wc.db "pragma integrity_check"
    

    That should report some errors.

    Then you might be able to clean them up by doing:

    sqlite3 .svn/wc.db "reindex nodes"
    sqlite3 .svn/wc.db "reindex pristine"
    

    If there are still errors after that, you still got the option to check out a fresh copy of the repository to a temporary folder and copy the .svn folder from the fresh copy to the old one. Then the old copy should work again and you can delete the temporary folder.

    0 讨论(0)
  • 2020-12-02 06:54

    If you install the Tortoise SVN, Please go to task manager and stop it. Then try to delete the folder. it will work

    0 讨论(0)
  • 2020-12-02 06:55
    1. check out this svn at another place
    2. show hidden .svn file
    3. replace wc file

    this works for me!

    0 讨论(0)
  • 2020-12-02 06:58

    Marked answer might be the correct one, according to subversion cleanup. But the error is definitely a generic one, which led me here, this question page.

    Our project has the dependency System.Data.SQLite and the error message was the same:

    database disk image is malformed

    In my case, I've executed following check script and the followings via SQLiteStudio 3.1.1.

    pragma integrity_check
    

    (I don't have any idea if these statistics would help, but I'm going to share them anyway...)

    The DataBase file is being used on everyday usage for 1.5 year, via the connection journal mode on Memory, and was about 750 MB large. There were approximately 140K records per table and 6 tables was this large.

    After the execution of Integrity Check script, 11 rows was returned after 30 minutes of execution time.

    wrong # of entries in index sqlite_autoindex_MyTableName_1
    wrong # of entries in index MyOtherTableAndOrIndexName_1
    wrong # of entries in index sqlite_autoindex_MyOtherTableAndOrIndexName_2
    etc...
    

    All the results were about the indexes. Following-up the re-building each indexes, my problem was resolved.

    reindex sqlite_autoindex_MyTableName_1;
    reindex MyOtherTableAndOrIndexName_1;
    reindex sqlite_autoindex_MyOtherTableAndOrIndexName_2;
    

    After re-indexing, the integrity check resulted "ok".

    I've got this error last year, and I was restored the DB from the backup, and then re-committed all the changes, which was a real nightmare...

    0 讨论(0)
提交回复
热议问题