Order by which supports database defaults for nulls last

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Order by which supports database defaults for nulls last

Jean-Noël Rouvignac-2
Hello,

Here is a patch changing the default sorting for nulls when using the order by clause. The patch was generated from hsqldb-2.2.6.zip available on Sourceforge.

According to https://hibernate.onjira.com/browse/HHH-465 :

        In different DBs, the sorting of nulls relative to other values is handled differently.
       
        PostgreSQL - Nulls are considered HIGHER than non-nulls.
        DB2 - Higher
        MSSQL - Lower
        MySQL - Lower
        Oracle - Higher

This patch is making sure that when using the Oracle or PostgreSQL, we are using the same ordering for nulls.
I also added a Boolean for sqlSyntaxDb2 since I had the information available. I leave it to someone interested to expand on it.

Please let me know if this patch is ok with you.

Thanks,
Jean-Noël Rouvignac


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
hsqldb-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers

orderBySupportsDatabaseDefaultsForNullsLast.patch (16K) Download Attachment