Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "no current record for fetch operation" when table inner join procedure inner join table [CORE4344] #4666

Closed
firebird-automations opened this issue Feb 18, 2014 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @sim1984

Is related to QA592

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 http://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 http://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 http://t1.id = t2.a
CON> join myproc(t1.a, t2.a) p on 1=1;

       B

============
3
3
6

Commits: 0719295 FirebirdSQL/fbt-repository@8762d53

====== Test Details ======

See also: CORE2155

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

This is a historical issue/limitation.

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Sorry, haven't yet read the v3 release notes.

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 3.0 Alpha 1 [ 10331 ]

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA592 [ QA592 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

Test Details: See also: CORE2155

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Test created.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants