Issue Details (XML | Word | Printable)

Key: CORE-4561
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

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

BUGCHECK(183) when use cursor with "order by ID+0" and "for update with lock"

Created: 27/Sep/14 06:07 PM   Updated: 03/Jun/15 06:42 AM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 2

File Attachments: 1. Zip Archive gdb-firebird.140927_215115.1.zip (16 kB)


QA Status: Done successfully
Test Details:
Confirmed on WI-T3.0.0.31852 (CS/SC/SS):
Statement failed, SQLSTATE = XX000
internal Firebird consistency check (wrong record length (183), file: vio.cpp line: 1310)


 Description  « Hide
DDL:
====
$ /opt/fb30trnk/bin/isql -q
SQL> create database 'tmpbug.fdb'; commit;
SQL> [root@oel64 21:49:49 fb30]$ /opt/fb30trnk/bin/isql -q
SQL> create database '/var/db/fb30/tmpbug.fdb'; commit;
SQL> connect 'localhost/3330:/var/db/fb30/tmpbug.fdb';
Database: 'localhost/3330:/var/db/fb30/tmpbug.fdb'
SQL> show version;
ISQL Version: LI-T3.0.0.31309 Firebird 3.0 Alpha 2
Server version:
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-T3.0.0.31309 Firebird 3.0 Alpha 2"
Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-T3.0.0.31309 Firebird 3.0 Alpha 2/tcp (oel64)/P13"
Firebird/Linux/AMD/Intel/x64 (remote interface), version "LI-T3.0.0.31309 Firebird 3.0 Alpha 2/tcp (oel64)/P13"
on disk structure version 12.0
SQL> recreate table tm(id int);
SQL> commit;
SQL> insert into tm(id) values(1);
SQL> insert into tm(id) values(2); -- at least TWO records need to be added
SQL> commit;

The following EB lead to bug check abort and message "wrong record length (183), file: vio.cpp line: 1311" in firebird.log:

select current_timestamp as dts,'before execute block. . .' as msg from rdb$database;
set term ^;
execute block as
begin
  for
    select id
    from tm
    order by id+0 -- "+0" is mandatory for getting BCA
    for update with lock -- and this also is mandatory
    as cursor c
  do begin
    delete from tm where current of c;
  end
end^
set term ;^
select current_timestamp as dts,'after execute block' as msg from rdb$database;
commit;

ISQL console:
---
Statement failed, SQLSTATE = 08006
Error reading data from the connection.
---

firebird.log:

oel64 Sat Sep 27 21:48:24 2014
        /opt/fb30trnk/bin/fbguard: guardian starting /opt/fb30trnk/bin/firebird



oel64 Sat Sep 27 21:51:15 2014
        Database: /var/db/fb30/tmpbug.fdb
        internal Firebird consistency check (wrong record length (183), file: vio.cpp line: 1311)


oel64 Sat Sep 27 21:51:15 2014
        /opt/fb30trnk/bin/fbguard: /opt/fb30trnk/bin/firebird terminated abnormally (-1)



oel64 Sat Sep 27 21:51:15 2014
        /opt/fb30trnk/bin/fbguard: guardian starting /opt/fb30trnk/bin/firebird



oel64 Sat Sep 27 21:51:24 2014
        REMOTE INTERFACE/gds__detach: Unsuccesful detach from database.
        Uncommitted work may have been lost.
        Error writing data to the connection.

Two stack traces (for SC ans SS) please see in attach.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dimitry Sibiryakov added a comment - 27/Sep/14 06:31 PM
The same side-effect of cursor stability as in CORE-4369