firebird
firebird copied to clipboard
The Large SQL crashes Firebird Server [CORE6536]
Submitted by: Vadim Mescheryakov (vadimmescheryakov)
Attachments: create-database-script.sql Large Query.sql
The Large SQL with 10000 OR operators and the size above 137 kb crashes Firebird Server 3.0.1 and 3.0.7.33374_1. The Firebird Server version 2.5 shows only this error "Unsuccessful execution caused by an unavailable resource. Implementation limit exceeded. block size exceeds implementation restriction." and it stills working
Commented by: Vadim Mescheryakov (vadimmescheryakov)
I attached two files for reproduction
Modified by: Vadim Mescheryakov (vadimmescheryakov)
Attachment: create-database-script.sql [ 13580 ]
Attachment: Large Query.sql [ 13581 ]
Commented by: @dyemanov
Looks like a duplicate for CORE6223 and CORE395. Binary operations (+ - * / AND OR) are parsed and evaluated recursively and stack size is a limited resource, thus causing a crash (or stack overflow error sometimes) when a number of arguments becomes too big.
Commented by: Vadim Mescheryakov (vadimmescheryakov)
FB 2.5 copes well with this SQL
Commented by: @dyemanov
AFAIU, it does not execute your query at all -- due to "block size exceeds implementation restriction" error.
Commented by: Vadim Mescheryakov (vadimmescheryakov)
Yes. I meant "copes" in sense - Fb 2.5 doesn't crash, only returns error
QA note: see test for #8255