Issue Details (XML | Word | Printable)

Key: CORE-3313
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Attila Molnár
Votes: 0
Watchers: 1
Operations

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

Firebird 2.5 UTF8 database, WIN1250 client problem

Created: 20/Jan/11 08:24 AM   Updated: 02/Feb/11 10:30 AM
Component/s: Charsets/Collation
Affects Version/s: 2.5.0
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Duplicate
 

Planning Status: Unspecified


 Description  « Hide
Hi!

I've got two tables, and one of them has a trigger, which insert or
update data to the other table in case of inserting.

The followong SQL gives error when I connect with WIN1250, but works
fine with UTF8. If I'm not mistaken the client side charset sould not
affect the result.

INSERT INTO sz_felirat_szall (id, nyelv_kod, mezonev, ertek)
VALUES (2065664, '00', 'LEV_SKOMP', 'Szállítói tartozásunk kiegyenlítése')

Error :
"arithmetic exception, numeric overflow, or string truncation.
string right truncation.
At trigger 'INSERTSZ_FELIRAT_SZALL' line: 17, col: 3."


CREATE TABLE SZ_FELIRAT (
    NYELV_KOD XVAR2N /* XVAR2N = VARCHAR(2) NOT NULL */,
    ...
    LEV_SKOMP XVAR40 /* XVAR40 = VARCHAR(40) */,
    ...
);

CREATE TABLE SZ_FELIRAT_SZALL (
    ID XIDN /* XIDN = INTEGER NOT NULL */,
    NYELV_KOD XVAR2N DEFAULT '00' /* XVAR2N = VARCHAR(2) NOT NULL */,
    MEZONEV XVAR30N /* XVAR30N = VARCHAR(30) NOT NULL */,
    ERTEK XVAR100N /* XVAR100N = VARCHAR(100) NOT NULL */
);

CREATE OR ALTER TRIGGER insertsz_felirat_szall FOR sz_felirat_szall
ACTIVE BEFORE INSERT POSITION 0
AS
DECLARE VARIABLE ins VARCHAR(300);
DECLARE VARIABLE db INTEGER DEFAULT 0;
BEGIN
  IF (NEW.id IS NULL) THEN NEW.id = GEN_ID(xid_gen, 1);
  IF (NEW.nyelv_kod IS NULL) THEN NEW.nyelv_kod = '00';
  SELECT
      COUNT(1)
  FROM sz_felirat
  WHERE nyelv_kod = NEW.nyelv_kod
  INTO :db;
  IF (db = 0) THEN INSERT INTO sz_felirat (nyelv_kod)
    VALUES (NEW.nyelv_kod);
  ins = 'update sz_felirat set ' || NEW.mezonev || '=''' || REPLACE(NEW.ertek, '''', '''''') || ''' where nyelv_kod = ''' || NEW.nyelv_kod || ''' and coalesce(' || NEW.mezonev || ', '''') = ''''';
  EXECUTE STATEMENT ins;
END

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 20/Jan/11 08:33 AM
Have you tried any recent v2.5.1 snapshot build?

Attila Molnár added a comment - 20/Jan/11 12:51 PM - edited
I've tried it now. Works with it. When the 2.5.1 will be released?

It this related to CORE-3282?

Dmitry Yemanov added a comment - 20/Jan/11 03:06 PM
Yes, it looks similar to CORE-3282, although it is about "cannot transliterate" rather than "string truncation".
As for the release date, it's currently considered for February.

Dmitry Yemanov added a comment - 02/Feb/11 08:25 AM
Duplicates CORE-3282.