Watch, Follow, &
Connect with Us
Public Report
Report From: InterBase/Server    [ Add a report in this area ]  
Report #:  115957   Status: Reported
Concatenation of two strings returned by substr udf return empty string when first parameter is bigger then second
Project:  InterBase Build #:  WI-V10.0.5.595
Version:    10.0 Submitted By:   Karol Bieniaszewski
Report Type:  Basic functionality failure Date Reported:  5/22/2013 6:11:44 AM
Severity:    Serious / Highly visible problem Last Updated: 5/22/2013 6:40:06 AM
Platform:    Windows 95/98/NT 4.0 on Intel Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Concatenation of two strings returned by substr udf return empty string when first parameter is bigger then second

see [STEPS]
Steps to Reproduce:
1. Connect to Employe
2. add definition of external function

DECLARE EXTERNAL FUNCTION SUBSTR
CSTRING(80) CHARACTER SET WIN1250, SMALLINT, SMALLINT
RETURNS CSTRING(80) CHARACTER SET WIN1250 FREE_IT
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf.dll';


DECLARE EXTERNAL FUNCTION STRLEN
CSTRING(32767) CHARACTER SET WIN1250
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';

2. run this select (in first substr first parameter(value 2) is bigger then second (value 1)

SELECT SUBSTR('aaaa', 2, 1) || SUBSTR('bbbb', 1, 2)  FROM RDB$DATABASE

Now: return empty string ''
Exp: return 'bb'

SELECT SUBSTR('aaaa', 2, 1) || 'bb'  FROM RDB$DATABASE

Now: return empty string ''
Exp: return 'bb'

SELECT STRLEN(SUBSTR('aaaa', 2, 1) || SUBSTR('bbbb', 1, 2))  FROM RDB$DATABASE
return 0

SELECT STRLEN(SUBSTR('aaaa', 2, 1)), STRLEN(SUBSTR('bbbb', 1, 2))  FROM RDB$DATABASE
return 0, 2


i test this in IBConsole and also in isql - the same result
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01