Fix minor issues with new unicode {de,re}composition code
authorMichael Paquier <[email protected]>
Sat, 7 Nov 2020 01:15:58 +0000 (10:15 +0900)
committerMichael Paquier <[email protected]>
Sat, 7 Nov 2020 01:15:58 +0000 (10:15 +0900)
The table generation script would incorrectly complain in the
recomposition sorting when matching code points.  This would not have
caused the generation of an incorrect table.  Note that this condition
is not reachable yet, but could have been reached with future updates.

pg_bswap.h does not need to be included in the frontend.x

Author: John Naylor
Discussion: https://postgr.es/m/CAFBsxsGWmExpvv=61vtDKCs7+kBbhkwBDL2Ph9CacziFKnV_yw@mail.gmail.com

src/common/unicode/generate-unicode_norm_table.pl
src/common/unicode_norm.c

index e4d3ccc2346a81459950802436cd224cfd6939de..8213532ab9dd38f903b17acbe341a02f3cee949b 100644 (file)
@@ -400,7 +400,7 @@ sub recomp_sort
    my $bcode = hex($b->{code});
 
    return -1 if $acode < $bcode;
-   return -1 if $acode > $bcode;
+   return  if $acode > $bcode;
 
    die "found duplicate entries of recomposeable code pairs";
 }
index abb83cbf985e0676f3782dfbb7978716a777bea8..d46e33d322cecec3d832e579954b3fc3ebc4fa9d 100644 (file)
 #ifndef FRONTEND
 #include "common/unicode_norm_hashfunc.h"
 #include "common/unicode_normprops_table.h"
+#include "port/pg_bswap.h"
 #else
 #include "common/unicode_norm_table.h"
 #endif
-#include "port/pg_bswap.h"
 
 #ifndef FRONTEND
 #define ALLOC(size) palloc(size)