Skip to content

Firebird 5.0.2 - Error with UPDATE OR INSERT INTO with RETURNING clause of OLD values #8616

Closed
@zedalaye

Description

@zedalaye

See the discussion with examples here : #8615

Given this expurged table definition:

CREATE TABLE MAGASINS (
    UID   CHAR(16) CHARACTER SET OCTETS NOT NULL,
    CODE  CHAR(12) NOT NULL
)

This query fails when run more than once:

update or insert into MAGASINS(UID, CODE)
values (x'B961790496A042E9957F03A4D1C86726', 'CODE')
matching (UID) 
returning
  UID,
  OLD.CODE as "OLD.CODE"

The error is:

arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 1, actual 12
Arithmetic overflow or division by zero has occurred.
GDS Code: 335544321 - SQL Code: -802 - Error Code: 1.

The same query works as expected in Firebird 3.0.9+, this sounds like a regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions