Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8eda3eb

Browse files
committed
Use sort_template.h for qsort_tuple() and qsort_ssup().
Replace the Perl code previously used to generate specialized sortfunctions with sort_template.h.Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://postgr.es/m/CA%2BhUKGJ2-eaDqAum5bxhpMNhvuJmRDZxB_Tow0n-gse%2BHG0Yig%40mail.gmail.com
1 parentf374f4d commit8eda3eb

File tree

7 files changed

+21
-296
lines changed

7 files changed

+21
-296
lines changed

‎src/backend/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ distprep:
190190
$(MAKE) -C utilsdistprep
191191
$(MAKE) -C utils/adtjsonpath_gram.c jsonpath_scan.c
192192
$(MAKE) -C utils/miscguc-file.c
193-
$(MAKE) -C utils/sortqsort_tuple.c
194193

195194

196195
##########################################################################
@@ -312,8 +311,7 @@ maintainer-clean: distclean
312311
storage/lmgr/lwlocknames.h\
313312
utils/adt/jsonpath_gram.c\
314313
utils/adt/jsonpath_scan.c\
315-
utils/misc/guc-file.c\
316-
utils/sort/qsort_tuple.c
314+
utils/misc/guc-file.c
317315

318316

319317
##########################################################################

‎src/backend/utils/sort/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎src/backend/utils/sort/Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,4 @@ OBJS = \
2121
tuplesort.o\
2222
tuplestore.o
2323

24-
tuplesort.o: qsort_tuple.c
25-
26-
qsort_tuple.c: gen_qsort_tuple.pl
27-
$(PERL)$(srcdir)/gen_qsort_tuple.pl$<>$@
28-
2924
include$(top_srcdir)/src/backend/common.mk
30-
31-
maintainer-clean:
32-
rm -f qsort_tuple.c

‎src/backend/utils/sort/gen_qsort_tuple.pl

Lines changed: 0 additions & 272 deletions
This file was deleted.

‎src/backend/utils/sort/tuplesort.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,27 @@ static void tuplesort_updatemax(Tuplesortstate *state);
676676
* reduces to ApplySortComparator(), that is single-key MinimalTuple sorts
677677
* and Datum sorts.
678678
*/
679-
#include"qsort_tuple.c"
680679

680+
#defineST_SORT qsort_tuple
681+
#defineST_ELEMENT_TYPE SortTuple
682+
#defineST_COMPARE_RUNTIME_POINTER
683+
#defineST_COMPARE_ARG_TYPE Tuplesortstate
684+
#defineST_CHECK_FOR_INTERRUPTS
685+
#defineST_SCOPE static
686+
#defineST_DECLARE
687+
#defineST_DEFINE
688+
#include"lib/sort_template.h"
689+
690+
#defineST_SORT qsort_ssup
691+
#defineST_ELEMENT_TYPE SortTuple
692+
#defineST_COMPARE(a,b,ssup) \
693+
ApplySortComparator((a)->datum1, (a)->isnull1, \
694+
(b)->datum1, (b)->isnull1, (ssup))
695+
#defineST_COMPARE_ARG_TYPE SortSupportData
696+
#defineST_CHECK_FOR_INTERRUPTS
697+
#defineST_SCOPE static
698+
#defineST_DEFINE
699+
#include"lib/sort_template.h"
681700

682701
/*
683702
*tuplesort_begin_xxx

‎src/tools/msvc/Solution.pm

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,6 @@ sub GenerateFiles
665665
);
666666
}
667667

668-
if (IsNewer(
669-
'src/backend/utils/sort/qsort_tuple.c',
670-
'src/backend/utils/sort/gen_qsort_tuple.pl'))
671-
{
672-
print"Generating qsort_tuple.c...\n";
673-
system(
674-
'perl src/backend/utils/sort/gen_qsort_tuple.pl > src/backend/utils/sort/qsort_tuple.c'
675-
);
676-
}
677-
678668
if (IsNewer('src/bin/psql/sql_help.h','src/bin/psql/create_help.pl'))
679669
{
680670
print"Generating sql_help.h...\n";

‎src/tools/msvc/clean.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ if %DIST%==1 if exist src\backend\storage\lmgr\lwlocknames.h del /q src\backend\
6262
if%DIST%==1ifexist src\pl\plpython\spiexceptions.hdel /q src\pl\plpython\spiexceptions.h
6363
if%DIST%==1ifexist src\pl\plpgsql\src\plerrcodes.hdel /q src\pl\plpgsql\src\plerrcodes.h
6464
if%DIST%==1ifexist src\pl\tcl\pltclerrcodes.hdel /q src\pl\tcl\pltclerrcodes.h
65-
if%DIST%==1ifexist src\backend\utils\sort\qsort_tuple.cdel /q src\backend\utils\sort\qsort_tuple.c
6665
if%DIST%==1ifexist src\bin\psql\sql_help.cdel /q src\bin\psql\sql_help.c
6766
if%DIST%==1ifexist src\bin\psql\sql_help.hdel /q src\bin\psql\sql_help.h
6867
if%DIST%==1ifexist src\common\kwlist_d.hdel /q src\common\kwlist_d.h

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp