ora2pg
ora2pg copied to clipboard
NULL test for global variable fails if testing for NULL and empty string
The line:
IF (g_bgm_imp_id IS NOT NULL) THEN
gets translated to:
IF (current_setting('bgm_file_import.g_bgm_imp_id')::(numeric(38) IS NOT NULL AND (numeric(38))::text <> '')) THEN
where g_bgm_imp_id is a global variable. With the NULL_EQUAL_EMPTY setting.
Right, the case where global variable was tested against NULL was not handled by Ora2Pg, commit 901d29b might fix this issue.
Actually for this test NULL_EQUAL_EMPTY doesn't apply, the translation of your example will be the following:
IF ( current_setting('bgm_file_import.g_bgm_imp_id') != '' ) THEN