FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.25k stars 215 forks source link

INSERT statement with RETURNING clause raises error 504 ("Unknown cursor from isc_dsql_fetch command") [CORE2903] #3287

Closed firebird-automations closed 14 years ago

firebird-automations commented 14 years ago

Submitted by: Grenzi Lucio (seawolf)

Relate to CORE3203

CREATE TABLE STRING_VALUES ( S_ID Integer NOT NULL, S_CHAR Char(255), S_VARCHAR Varchar(255), S_NCHAR Char(255), S_NVARCHAR Varchar(255), S_BIT Blob sub_type 1, S_VARBIT Blob sub_type 0, PRIMARY KEY (S_ID) );

create this table with no data Do the following operations:

DELETE FROM STRING_VALUES WHERE S_ID=1 INSERT INTO string_values VALUES (1,'''', '''', '''', '''', NULL, NULL) RETURNING S_ID

It works correctly on FB 2.1 .. with FB 2.5 RC1 and FB 2.5 RC 2 we receviced Error 504: Unknown cursor from isc_dsql_fetch command

This error is caused because of INSERT operation returns no data

firebird-automations commented 14 years ago

Commented by: @hvlad

I can't reproduce it :

SQL> create database '2903.fdb'; SQL> SQL> show version; ISQL Version: WI-V2.5.0.25920 Firebird 2.5 Release Candidate 2 Server version: Firebird/x86/Windows NT (access method), version "WI-V2.5.0.25920 Firebird 2.5 Release Candidate 2" Firebird/x86/Windows NT (remote server), version "WI-V2.5.0.25920 Firebird 2.5 Release Candidate 2/XNet (W2K3-X64)/P12" Firebird/x86/Windows NT (remote interface), version "WI-V2.5.0.25920 Firebird 2.5 Release Candidate 2/XNet (W2K3-X64)/P12" on disk structure version 11.2 SQL> SQL> CREATE TABLE STRING_VALUES CON> ( CON> S_ID Integer NOT NULL, CON> S_CHAR Char(255), CON> S_VARCHAR Varchar(255), CON> S_NCHAR Char(255), CON> S_NVARCHAR Varchar(255), CON> S_BIT Blob sub_type 1, CON> S_VARBIT Blob sub_type 0, CON> PRIMARY KEY (S_ID) CON> ); SQL> DELETE FROM STRING_VALUES WHERE S_ID=1; SQL> INSERT INTO string_values VALUES (1,'''', '''', '''', '''', NULL, NULL) RETURNING S_ID;

S_ID 1

firebird-automations commented 14 years ago

Commented by: @asfernandes

AFAIR, the statement should be described like an execute procedure, and you shouldn't use isc_dsql_fetch.

firebird-automations commented 14 years ago

Commented by: Sean Leyne (seanleyne)

It seems the current functionality is "As Designed" and operating correctly.

firebird-automations commented 14 years ago
Modified by: Sean Leyne (seanleyne) status: Open \[ 1 \] =\> Resolved \[ 5 \] resolution: Won't Fix \[ 2 \]
firebird-automations commented 14 years ago
Modified by: Sean Leyne (seanleyne) summary: Returning clause raise an 504 error =\> INSERT statement with RETURNING clause raises error 504 \("Unknown cursor from isc\_dsql\_fetch command"\)
firebird-automations commented 14 years ago
Modified by: @pcisar status: Resolved \[ 5 \] =\> Closed \[ 6 \]
firebird-automations commented 14 years ago
Modified by: @dyemanov Link: This issue relate to [CORE3203](https://github.com/FirebirdSQL/firebird/issues?q=CORE3203+in%3Atitle) \[ [CORE3203](https://github.com/FirebirdSQL/firebird/issues?q=CORE3203+in%3Atitle) \]