Issue Details (XML | Word | Printable)

Key: CORE-4344
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Simonov Denis
Votes: 0
Watchers: 3
Operations

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

Error "no current record for fetch operation" when table inner join procedure inner join table

Created: 18/Feb/14 04:24 PM   Updated: 23/Sep/15 12:41 PM
Component/s: None
Affects Version/s: 3.0 Alpha 1, 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

Environment: isql
Issue Links:
Relate
 

QA Status: Done successfully
Test Details: See also: CORE-2155


 Description  « Hide
SET SQL DIALECT 3;

SET NAMES WIN1251;

CREATE DATABASE 'localhost:d:\fb\fb30\data\test.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET WIN1251;


CREATE TABLE T (
    ID INTEGER NOT NULL,
    A INTEGER,
    B INTEGER
);


INSERT INTO T (ID, A, B) VALUES (1, 2, 3);
INSERT INTO T (ID, A, B) VALUES (2, 1, 3);
INSERT INTO T (ID, A, B) VALUES (3, 3, 2);

COMMIT WORK;


ALTER TABLE T ADD PRIMARY KEY (ID);


SET TERM ^ ;

CREATE PROCEDURE MYPROC (
    A INTEGER,
    C INTEGER)
RETURNS (
    B INTEGER)
AS
begin
  b = a + c;
  suspend;
end^

SET TERM ; ^

SQL> select t3.*
CON> from t t1
CON> join t t2 on t1.id = t2.a
CON> left join myproc(t1.a, t2.a) p on 1=1
CON> join t t3 on p.b = t3.b;

          ID A B
============ ============ ============
           1 2 3
           1 2 3
           2 1 3
           2 1 3

SQL> select t3.*
CON> from t t1
CON> join t t2 on t1.id = t2.a
CON> join myproc(t1.a, t2.a) p on 1=1
CON> join t t3 on p.b = t3.b;

          ID A B
============ ============ ============
Statement failed, SQLSTATE = 22000
no current record for fetch operation <-- Why?
SQL> select p.*
CON> from t t1
CON> join t t2 on t1.id = t2.a
CON> join myproc(t1.a, t2.a) p on 1=1;

           B
============
           3
           3
           6

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov made changes - 18/Feb/14 04:44 PM
Field Original Value New Value
Assignee Dmitry Yemanov [ dimitr ]
Sean Leyne added a comment - 18/Feb/14 05:29 PM
This is a historical issue/limitation.

At the very least, this is not a "Major" priority -- there are simple workarounds.

Simonov Denis added a comment - 18/Feb/14 06:39 PM
Sean Leyne, in Firebird 3 was declared that INNER JOIN can be done now with dependent procedures and for simpler cases it really works. For this reason this ticket was created. I know that this historical restriction and never worked.

Sean Leyne added a comment - 18/Feb/14 07:02 PM
Sorry, haven't yet read the v3 release notes.

It would have been appropriate to note that the case was about new feature...

Dmitry Yemanov made changes - 19/Feb/14 10:19 AM
Summary "no current record for fetch operation" when table inner join procedure inner join table Error "no current record for fetch operation" when table inner join procedure inner join table
Affects Version/s 3.0 Alpha 1 [ 10331 ]
Dmitry Yemanov made changes - 19/Feb/14 10:19 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0 Beta 1 [ 10332 ]
Resolution Fixed [ 1 ]
Pavel Cisar made changes - 29/Mar/14 05:55 PM
Link This issue is related to QA-592 [ QA-592 ]
Pavel Zotov made changes - 28/May/15 02:41 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status Done successfully
Pavel Zotov made changes - 28/May/15 03:34 PM
Status Resolved [ 5 ] Resolved [ 5 ]
Test Details See also: CORE-2155
Pavel Cisar added a comment - 23/Sep/15 12:41 PM
Test created.

Pavel Cisar made changes - 23/Sep/15 12:41 PM
Status Resolved [ 5 ] Closed [ 6 ]