Fix a critical bug in sqlite