That's just weird. Delete the metadata.db file and try this command
Code:
calibre-debug -c "from calibre.library.sqlite import DBThread; from calibre.resources import metadata_sqlite; from calibre.utils.config import prefs; t = DBThread(prefs['library_path']+'\\'+'metadata.db', False); t.connect(); t.conn.executescript(metadata_sqlite); t.conn.execute('pragma user_version=1'); t.conn.commit()"
If that works, then try the calibre-debug command in my previous post