I received a normal SMS (GSM SMS, not iMessage) from my friend on my iPhone 4 running iOS 7.1.2. There were lots of messages (more than 10K) in that chat thread before the last message received. When I opened that SMS, I saw that there is only one message in that thread. All previous messages were deleted after receiving that SMS.
I tried reopening the Messages application, restarting my iPhone, scrolling up after more messages received, but no luck.
After that, I logged in to my iPhone with SSH and downloaded the SMS db file (~31MB) located in
/var/mobile/Library/SMS/sms.db. I opened the db file with sqlite3, there were 36K SMS/iMessages, but there were no messages before the last message in that thread in the database file.
Is there any reasonable scenario that cause this data loss? How can I recover those deleted messages?