We received the following error.
Error: 697, Severity: 21, State: 1
00:0011:00000:00328:2014/01/27 14:18:57.02 server An attempt was made to fetch logical page '7050465' for database 'foo' (104), object 'bar' (1697438090), index 'bar_p' (2), partition 'bar_p_1697438090' (1697438090) from cache 'default data cache'. Wrong logical page '1216409856' was found in cache.
We are on ASE 15.7 ESD#4.2
Looking at the data, I found a "duplicate" row in the table, even though there is a unique index on the table. The table has a composite key, and all three columns matched on the two rows, but one of the columns is a char and the case was different on the two rows. Our database is set to be case insensitive, so the duplicate row should not have occurred.
This is the second time this has happened on the exact same row.
A workaround to get us out of the situation, is to drop the index, delete the duplicate rows, recreate the index, and reinsert the row that had the problem. That gets us out of the immediate problem, but does not stop it from happening again.
Any ideas as to why this happened? The index was there when the duplicate row appeared, and the settings on the database had not been changed.
We did hear back from Sybase that there is a bug where use of the merge statement can cause this. But we are not using the merge statement, we either do an update from an old legacy PowerBuilder app, or we do a delete and insert via a stored proc. We have not yet incorporated the merge statement in any of our code.