Subject Firebird upgrade 1.0.3 -> 1.5 and crashing of long-running query.
Author tibotaka
After upgrading from Firebird 1.0.3 to 1.5 (including backup and
restore of database file) a long-running query crashed with error
codes (as shown by IB_SQL from ibobjects):
SQL ERROR CODE: -901
ISC ERROR CODE: 335544364 (request synchronization error)

Detail description of situation:
Old system
PC P4 3GHz 1 GB RAM OS M$ Windows XP SP2, etc...
Firebird 1.0.3 WI-V6.2.972

New system
The same hardware and OS (it is the same machine)
Firebird 1.5 V.1.5.2.4731

Query type

SELECT *
FROM SPS_CONTRACT$RESULT_BOOK(:APRODUCT_YEAR_EDITION
, :APRODUCT_TYPE
, :ACAMPAIGN_YEAR_EDITION
, :ACAMPAIGN_REGION_ID
, :ADATE_TO
, :ACUSTOMER_REGION_ID)

where SPS_CONTRACT$RESULT_BOOK is selectable stored procedure (with
recursive calls). The procedure body is too complex and big to show
it in this message, but it doesn't seem to be syntax or semantic
problem, because e.g.

SELECT *
FROM SPS_CONTRACT$RESULT_BOOK(2004
, `'
, NULL
, NULL
, '31.03.2004'
, -1)

is running smoothly on "NEW" Firebird and gives all 180
result rows
after about 20 minutes, but

SELECT *
FROM SPS_CONTRACT$RESULT_BOOK(2004
, `'
, NULL
, NULL
, '31.03.2005'
, -1)

gives only first 144 result rows after about 40 minutes and crashes
with error codes from beginning of this message. The only difference
is in "ADATE_TO" parameter and consequently in the amount of
data to
be proceeded (approximately 79.217 rows against 147.211 rows in the
2nd call). Both calls are running smoothly on "OLD"
Firebird...

Any suggestion, please?
Sorry for a quite long message and sorry for my English... ;-(

Tibor