#13 REPLACE() function and zero-length 3rd argument

open
nobody
5
2009-06-16
2009-06-16
YoungWoo Kim
No

Oracle:
SELECT REPLACE( 'AAbbAA', 'A', '') FROM DUAL;
It returns 'bb'.

MySQL:
SELECT REPLACE( 'AAbbAA', 'A', '');
It Also returns 'bb'.

CloudBase:
SELECT REPLACE( 'AAbbAA', 'A', '') FROM DUAL;
CB returns NULL.

Discussion

  • YoungWoo Kim
    YoungWoo Kim
    2009-10-09

    I got a same problem on replaceall().

    select replaceall( 'a b c d', '\s+', '') as f_replaceall1 from dual;

    I've expected 'abcd' as the result. but the query returns 'null'.

    This makes test failure on '23.rs'.