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
Operations

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: 07/Oct/08 09:30 AM
Component/s: Engine
Affects Version/s: 2.1 Beta 2
Fix Version/s: 2.1 RC1

Time Tracking:
Not Specified

Environment: FB 2.1.0.16780, WinXP SP2
Issue Links:
Relate
 


 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   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vladimir Kozlov added a comment - 02/Nov/07 09:53 AM - edited
2.1.0.16967 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