I'm using H2 DB v1.4.182 for my test environment. It acts as a substitute in place of Oracle, which is the production vendor. I have a few aliases I create using a script in my test environment:
CREATE ALIAS IF NOT EXISTS REGEXP_LIKE as $$ boolean regexpLike(String s, String p) { return java.util.regex.Pattern.compile(p).matcher(s).find(); } $$;
CREATE ALIAS IF NOT EXISTS TO_NUMBER as $$ long toNumber(String s) { return Long.valueOf(s); } $$;
CREATE ALIAS if NOT EXISTS fn_val_check3 for "fakedata.testutil.TestUtil.fn_val_check";
The first two aliases show up in the INFORMATION_SCHEMA.FUNCTION_ALIASES
table, the last one (fn_val_check3
) doesn't.
SELECT ALIAS_NAME FROM INFORMATION_SCHEMA.FUNCTION_ALIASES;
Gives me two rows
ALIAS_NAME
TO_NUMBER
REGEXP_LIKE
I verified that H2 has the other alias somewhere by running the CREATE ALIAS ...
directly in the console and it says
CREATE ALIAS fn_val_check3 for "fakedata.testutil.TestUtil.fn_val_check";
Function alias "FN_VAL_CHECK3" already exists; SQL statement: CREATE ALIAS fn_val_check3 for "fakedata.testutil.TestUtil.fn_val_check" [90076-182] 90076/90076 (Help)
I'm using a validation component to verify the function exists in the database, which is why I'm wondering. Am I missing something or is this a known thing?