Issue Details (XML | Word | Printable)

Key: CORE-1560
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Vladimir Kozlov
Votes: 0
Watchers: 1

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

NULLIF crashes when first parameter is constant empty string

Created: 02/Nov/07 09:43 AM   Updated: 28/May/15 03:50 PM
Component/s: Engine
Affects Version/s: 2.1 Beta 2
Fix Version/s: 2.1 RC1

Environment: FB, WinXP SP2
Issue Links:

QA Status: Done successfully

 Description  « Hide
NULLIF crashes when first parameter is constant empty string and second parameter is constant or variable with empty string.

for example:

declare variable i varchar(10);
declare variable j varchar(10);

i = ''; j = nullif(i,i); - works

i = 'aaa'; j = nullif('',i); - works

i = ''; j = nullif('',i); - server crashes

Easiest way to reproduce:

select nullif('','') from rdb$database

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vladimir Kozlov added a comment - 02/Nov/07 09:53 AM - edited affected too.

Alexander Peshkov added a comment - 02/Nov/07 10:51 AM
Cast from NULL to string value of 0 length was broken. Looks like it happened only with nullif('','').

Philippe Makowski added a comment - 07/Oct/08 09:30 AM
Q/A test ok