Merge branch 'hotfix/4431'

Close #4431
fixed signature of loadConstraintReferences #4438
fix iterating over empty hydrating result set with buffering enabled
fix for tests
fixed rewind when buffering is not enabled
Merge pull request #4450 from mrsombre/hotfix/result-set-with-buffer

Fix iterating over empty result set with buffering enabled
Merge branch 'hotfix/4450' into develop

Forward port #4450