I checked that it affects 5.x. Also, created new PR, as previous was too far behind master. See https://github.com/hibernate/hibernate-orm/pull/1123.