This has been fixed for HSQL in the 2.2 branch, needs to be fixed for mysql and postgres and merged to trunk and 2.3 branch.