Skip to content

Commit

Permalink
HHH-15266 Fix NPE during function logging due to wrong character_leng…
Browse files Browse the repository at this point in the history
…th alternative key registration
  • Loading branch information
beikov committed May 13, 2022
1 parent a2b6e6d commit 22d018f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -1361,7 +1361,7 @@ public void length_characterLength_pattern(String clobPattern) {
"character_length",
new LengthFunction( "character_length", "character_length(?1)", clobPattern, typeConfiguration )
);
functionRegistry.registerAlternateKey( "character_length", "length" );
functionRegistry.registerAlternateKey( "length", "character_length" );
}

/**
Expand Down
Expand Up @@ -292,6 +292,7 @@ public SqmFunctionDescriptor wrapInJdbcEscape(String name, SqmFunctionDescriptor
}

public void registerAlternateKey(String alternateKey, String mappedKey) {
assert functionMap.containsKey( mappedKey );
log.debugf( "Registering alternate key : %s -> %s", alternateKey, mappedKey );
alternateKeyMap.put( alternateKey, mappedKey );
}
Expand Down

0 comments on commit 22d018f

Please sign in to comment.