Issue Details (XML | Word | Printable)

Key: CORE-5459
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Vlad Khorsun
Reporter: Hossein Daneshvar
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

do not delete * from mytable (21 records)

Created: 18/Jan/17 11:35 AM   Updated: 07/Feb/17 11:24 AM
Component/s: Engine
Affects Version/s: 3.0.1
Fix Version/s: None

Environment: Windows 7 32 bit

QA Status: No test


 Description  « Hide
Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

Download Link Database "VSPRING95" : https://goo.gl/PJDS0l

1."select * from "StudentPay" order by "Key"" = 6864 records

2.execute "delete from "StudentPay""

3.after execute delete all :
  result of "select * from "StudentPay"" = 0 record
  result of "select * from "StudentPay" order by "Key"" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from "StudentPay"" = 0 record
result of "select * from "StudentPay" order by "Key"" = 0

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Hossein Daneshvar made changes - 18/Jan/17 11:40 AM
Field Original Value New Value
Description Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

1."select * from mytable order by pk" = 6864 records

2.execute "delete * from mytable"

3.after execute delete all :
  result of "select * from mytable" = 0 record
  result of "select * from mytable order by pk" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from mytable" = 0 record
result of "select * from mytable order by pk" = 0
Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

1."select * from "StudentPay" order by pk" = 6864 records

2.execute "delete * from "StudentPay""

3.after execute delete all :
  result of "select * from "StudentPay"" = 0 record
  result of "select * from "StudentPay" order by "Key"" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from "StudentPay"" = 0 record
result of "select * from "StudentPay" order by "Key"" = 0
Hossein Daneshvar made changes - 18/Jan/17 12:03 PM
Description Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

1."select * from "StudentPay" order by pk" = 6864 records

2.execute "delete * from "StudentPay""

3.after execute delete all :
  result of "select * from "StudentPay"" = 0 record
  result of "select * from "StudentPay" order by "Key"" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from "StudentPay"" = 0 record
result of "select * from "StudentPay" order by "Key"" = 0
Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

Download Link Database "VSPRING95" : https://goo.gl/PJDS0l

1."select * from "StudentPay" order by pk" = 6864 records

2.execute "delete * from "StudentPay""

3.after execute delete all :
  result of "select * from "StudentPay"" = 0 record
  result of "select * from "StudentPay" order by "Key"" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from "StudentPay"" = 0 record
result of "select * from "StudentPay" order by "Key"" = 0
Hossein Daneshvar made changes - 18/Jan/17 09:31 PM
Description Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

Download Link Database "VSPRING95" : https://goo.gl/PJDS0l

1."select * from "StudentPay" order by pk" = 6864 records

2.execute "delete * from "StudentPay""

3.after execute delete all :
  result of "select * from "StudentPay"" = 0 record
  result of "select * from "StudentPay" order by "Key"" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from "StudentPay"" = 0 record
result of "select * from "StudentPay" order by "Key"" = 0
Firebird 3.0.1.32609-0 SuperServer 32bit on Windows 7

Download Link Database "VSPRING95" : https://goo.gl/PJDS0l

1."select * from "StudentPay" order by "Key"" = 6864 records

2.execute "delete from "StudentPay""

3.after execute delete all :
  result of "select * from "StudentPay"" = 0 record
  result of "select * from "StudentPay" order by "Key"" = 21 records (do not delete this 21 records)

after backup and restore :
result of "select * from "StudentPay"" = 0 record
result of "select * from "StudentPay" order by "Key"" = 0
Vlad Khorsun made changes - 19/Jan/17 09:02 AM
Assignee Vlad Khorsun [ hvlad ]
Vlad Khorsun added a comment - 19/Jan/17 09:05 AM
Database have some inconsistencies at pointer pages (gfix show it)
Does Firebird or OS crashed ? Does FW always was ON at this database ?

Hossein Daneshvar added a comment - 23/Jan/17 10:17 PM
Yes, FW always On at this database.
The situation is terrible for Firebird 3.

Hossein Daneshvar made changes - 23/Jan/17 10:20 PM
Security Developers [ 10012 ]
Vlad Khorsun added a comment - 23/Jan/17 10:22 PM
With current snapshot build you can fix the corruption using gfix -v -full

To find and fix the reason i need a steps to reproduce this corruption.

Hossein Daneshvar added a comment - 23/Jan/17 10:49 PM - edited
Thanks, gfix in Firebird 3.0.2.32673 can fix the corruption.

But should the firebird engine to detecting the problem
Because this problem can cause a major financial miscalculation and the creation of financial losses.
for example :
update "StudentPay" set "Lock" = 0 where "Imported" = 1
delete from "StudentPay" where "Imported" = 1
select sum("Amount") from "StudentPay" where "DriverKey" = 643 -> 7000000 (is a disaster)

I during the 1 transaction :
1.update "StudentPay" set "Lock" = 0 where "Imported" = 1
2.delete from "StudentPay" where "Imported" = 1
3.insert into "StudentPay" ... ~7000 records import from excel file

this actions repeate several times in day

Vlad Khorsun added a comment - 25/Jan/17 07:01 PM
> this actions repeate several times in day

So, could you provide me with a test case ?

Vlad Khorsun added a comment - 07/Feb/17 11:24 AM
Is it still reproducible ? If yes, would you like to test special build with fix for this issue ?