Skip to content

Commit 86df390

Browse files
committed
Fixed descending sort order
1 parent 1379667 commit 86df390

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/jrd/sort.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,13 @@ void Sort::diddleKey(UCHAR* record, bool direction)
10471047
}
10481048
else
10491049
{
1050+
if (complement && n)
1051+
{
1052+
UCHAR* pp = p;
1053+
do {
1054+
*pp++ ^= -1;
1055+
} while (--n);
1056+
}
10501057
p[3] ^= 1 << 7;
10511058
((Decimal64*)p)->grabKey(lwp);
10521059
}
@@ -1060,6 +1067,13 @@ void Sort::diddleKey(UCHAR* record, bool direction)
10601067
}
10611068
else
10621069
{
1070+
if (complement && n)
1071+
{
1072+
UCHAR* pp = p;
1073+
do {
1074+
*pp++ ^= -1;
1075+
} while (--n);
1076+
}
10631077
p[3] ^= 1 << 7;
10641078
((Decimal128*)p)->grabKey(lwp);
10651079
}

0 commit comments

Comments
 (0)