Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
43499af4
Commit
43499af4
authored
Nov 19, 1999
by
Jan Wieck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New parallel regression test shell and related things.
Jan
parent
58d1eeaa
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1441 additions
and
849 deletions
+1441
-849
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+5
-5
src/backend/utils/cache/catcache.c
src/backend/utils/cache/catcache.c
+13
-1
src/test/regress/GNUmakefile
src/test/regress/GNUmakefile
+34
-1
src/test/regress/expected/numeric.out
src/test/regress/expected/numeric.out
+408
-418
src/test/regress/regress.sh
src/test/regress/regress.sh
+8
-2
src/test/regress/run_check.sh
src/test/regress/run_check.sh
+432
-0
src/test/regress/sql/numeric.sql
src/test/regress/sql/numeric.sql
+409
-422
src/test/regress/sql/run_check.tests
src/test/regress/sql/run_check.tests
+132
-0
No files found.
src/backend/access/transam/xlog.c
View file @
43499af4
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.
7 1999/10/25 03:07:42 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.
8 1999/11/19 18:51:47 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1253,15 +1253,15 @@ tryAgain:
...
@@ -1253,15 +1253,15 @@ tryAgain:
{
{
fd
=
errno
;
fd
=
errno
;
if
(
!
ReleaseDataFile
())
if
(
!
ReleaseDataFile
())
elog
(
STOP
,
"Open(
cntlfile
) failed: %d (and no one data file can be closed)"
,
elog
(
STOP
,
"Open(
\"
%s
\"
) failed: %d (and no one data file can be closed)"
,
fd
);
ControlFilePath
,
fd
);
goto
tryAgain
;
goto
tryAgain
;
}
}
if
(
fd
<
0
)
if
(
fd
<
0
)
elog
(
STOP
,
"Open(
cntlfile) failed: %d"
,
errno
);
elog
(
STOP
,
"Open(
\"
%s
\"
) failed: %d"
,
ControlFilePath
,
errno
);
if
(
read
(
fd
,
ControlFile
,
BLCKSZ
)
!=
BLCKSZ
)
if
(
read
(
fd
,
ControlFile
,
BLCKSZ
)
!=
BLCKSZ
)
elog
(
STOP
,
"Read(
cntlfile) failed: %d"
,
errno
);
elog
(
STOP
,
"Read(
\"
%s
\"
) failed: %d"
,
ControlFilePath
,
errno
);
close
(
fd
);
close
(
fd
);
...
...
src/backend/utils/cache/catcache.c
View file @
43499af4
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.5
1 1999/11/07 23:08:26 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.5
2 1999/11/19 18:51:48 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -983,11 +983,23 @@ SearchSysCache(struct catcache * cache,
...
@@ -983,11 +983,23 @@ SearchSysCache(struct catcache * cache,
* ----------------
* ----------------
*/
*/
/* ----------
* It is definitely insufficient. While modifying the regression
* test to run independent tests concurrently it happened, that
* this code fails VERY often. ISTM that 'cache' points into
* shared memory, but that 'busy' means this backend is loading
* a new entry. So when another backend has set busy, this one
* think's it detected a recursion.
*
* Need's a smarter detection mechanism - Jan
*
if (cache->busy)
if (cache->busy)
{
{
elog(ERROR, "SearchSysCache: recursive use of cache %d", cache->id);
elog(ERROR, "SearchSysCache: recursive use of cache %d", cache->id);
}
}
cache->busy = true;
cache->busy = true;
* ----------
*/
/* ----------------
/* ----------------
* open the relation associated with the cache
* open the relation associated with the cache
...
...
src/test/regress/GNUmakefile
View file @
43499af4
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.
19 1999/06/28 18:40:34 momjian
Exp $
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.
20 1999/11/19 18:51:48 wieck
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -91,6 +91,38 @@ else
...
@@ -91,6 +91,38 @@ else
endif
endif
@
echo
"ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
@
echo
"ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
#
# run the parallel test suite
#
runcheck
:
$(INFILES)
ifneq
($(PORTNAME), win)
MULTIBYTE
=
$(MULTIBYTE)
;
export
MULTIBYTE
;
\
$(SHELL)
./run_check.sh
$(PORTNAME)
else
MULTIBYTE
=
$(MULTIBYTE)
;
export
MULTIBYTE
;
\
./run_check.sh
$(PORTNAME)
endif
@
echo
"ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILES run_check.out"
@
echo
"AND regress.out"
@
echo
""
@
echo
"To run the optional big test(s) too, type 'make bigcheck'"
@
echo
"These big tests can take over an hour to complete"
@
echo
"These actually are:
$(EXTRA_TESTS)
"
#
# run the test including the huge extra tests
#
bigcheck
:
$(INFILES)
ifneq
($(PORTNAME), win)
MULTIBYTE
=
$(MULTIBYTE)
;
export
MULTIBYTE
;
\
$(SHELL)
./run_check.sh
$(PORTNAME)
$(EXTRA_TESTS)
else
MULTIBYTE
=
$(MULTIBYTE)
;
export
MULTIBYTE
;
\
./run_check.sh
$(PORTNAME)
$(EXTRA_TESTS)
endif
@
echo
"ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILES run_check.out"
@
echo
"AND regress.out"
clean
:
clean
:
rm
-f
$(INFILES)
regress.out regress.o regression.diffs
rm
-f
$(INFILES)
regress.out regress.o regression.diffs
ifeq
($(PORTNAME), win)
ifeq
($(PORTNAME), win)
...
@@ -100,3 +132,4 @@ endif
...
@@ -100,3 +132,4 @@ endif
$(MAKE)
-C
expected clean
$(MAKE)
-C
expected clean
$(MAKE)
-C
results clean
$(MAKE)
-C
results clean
$(MAKE)
-C
../../../contrib/spi clean
$(MAKE)
-C
../../../contrib/spi clean
rm
-rf
tmp_check
src/test/regress/expected/numeric.out
View file @
43499af4
This diff is collapsed.
Click to expand it.
src/test/regress/regress.sh
View file @
43499af4
#!/bin/sh
#!/bin/sh
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.3
1 1999/07/09 17:57:46 momjian
Exp $
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.3
2 1999/11/19 18:51:49 wieck
Exp $
#
#
if
[
$#
-eq
0
]
if
[
$#
-eq
0
]
then
then
...
@@ -76,7 +76,13 @@ fi
...
@@ -76,7 +76,13 @@ fi
echo
"=============== running regression queries... ================="
echo
"=============== running regression queries... ================="
echo
""
>
regression.diffs
echo
""
>
regression.diffs
for
i
in
`
cat
sql/tests
`
$mbtests
$extratests
stdtests
=
`
awk
'
$1=="test" { print $2; }
{}
'
< sql/run_check.tests
`
for
i
in
$stdtests
$mbtests
$extratests
do
do
$ECHO_N
"
${
i
}
.. "
$ECHO_C
$ECHO_N
"
${
i
}
.. "
$ECHO_C
$FRONTEND
regression < sql/
${
i
}
.sql
>
results/
${
i
}
.out 2>&1
$FRONTEND
regression < sql/
${
i
}
.sql
>
results/
${
i
}
.out 2>&1
...
...
src/test/regress/run_check.sh
0 → 100755
View file @
43499af4
#!/bin/sh
#
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.1 1999/11/19 18:51:49 wieck Exp $
# ----------
# This is currently needed because the actual 7.0 psql makes
# all tests fail. Set a path to an existing 6.5.x version of
# psql, the will be copied into the temporary installation
# as psql.
# ----------
TEMP_PSQL_HACK
=
`
which psql_65
`
# ----------
# Check call syntax
# ----------
if
[
$#
-eq
0
]
then
echo
"Syntax:
$0
<portname> [extra-tests]"
exit
1
fi
# ----------
# Change to the regression test directory explicitly
# ----------
cd
`
dirname
$0
`
# ----------
# Some paths used durint the test
# ----------
PWD
=
`
pwd
`
CHKDIR
=
$PWD
/tmp_check
PGDATA
=
$CHKDIR
/data
LIBDIR
=
$CHKDIR
/lib
BINDIR
=
$CHKDIR
/bin
LOGDIR
=
$CHKDIR
/log
TIMDIR
=
$CHKDIR
/timestamp
PGPORT
=
65432
PMPID
=
export
CHKDIR
export
PGDATA
export
LOGDIR
export
TIMDIR
export
PGPORT
# ----------
# Get the commandline parameters
# ----------
portname
=
$1
shift
extratests
=
"
$*
"
# ----------
# Special setting for Windows (no unix domain sockets)
# ----------
if
[
x
$portname
=
"xwin"
]
then
HOST
=
"-h localhost"
else
HOST
=
""
fi
# ----------
# Determine if echo -n works
# ----------
if
echo
'\c'
|
grep
-s
c
>
/dev/null 2>&1
then
ECHO_N
=
"echo -n"
ECHO_C
=
""
else
ECHO_N
=
"echo"
ECHO_C
=
'\c'
fi
# ----------
# Set timezone and datestyle explicitly
# ----------
PGTZ
=
"PST8PDT"
;
export
PGTZ
PGDATESTYLE
=
"Postgres,US"
;
export
PGDATESTYLE
# ----------
# The SQL shell to use during this test
# ----------
FRONTEND
=
"
$BINDIR
/psql
$HOST
-n -e -q"
# ----------
# Determine system type
# ----------
SYSTEM
=
`
/bin/sh ../../config.guess |
awk
-F
\-
'{ split($3,a,/[0-9]/); printf"%s-%s", $1,
a[1] }'
`
# ----------
# Catch SIGINT and SIGTERM to shutdown the postmaster
# ----------
trap
' echo ""
echo ""
echo "user abort ..."
if [ ! -z $PMPID ]
then
echo "Signalling postmaster with PID $PMPID to shutdown immediately"
kill -2 $PMPID
wait $PMPID
echo ""
fi
echo ""
exit 1
'
2 15
# ----------
# Prepare a clean check directory
# ----------
if
[
-e
$CHKDIR
]
then
echo
"=============== Removing old ./tmp_check directory ... ================"
rm
-rf
$CHKDIR
fi
echo
"=============== Create ./tmp_check directory ================"
mkdir
-p
$CHKDIR
mkdir
-p
$PGDATA
mkdir
-p
$LOGDIR
# ----------
# Install this build into ./tmp/check
# ----------
echo
"=============== Installing new build into ./tmp_check ================"
(
cd
../..
make
POSTGRESDIR
=
$CHKDIR
install
>
$LOGDIR
/install.log 2>&1
exit
$?
)
if
[
$?
-ne
0
]
then
echo
""
echo
"ERROR: Check installation failed - cannot continue"
echo
"Please examine
$LOGDIR
/install.log"
echo
"for the errors occured."
echo
""
exit
2
fi
# ----------
# Copy an explicitly to use psql shell over the built one
# ----------
if
[
!
-z
"
$TEMP_PSQL_HACK
"
]
;
then
rm
-f
$BINDIR
/psql
cp
$TEMP_PSQL_HACK
$BINDIR
/psql
fi
# ----------
# Change the path so that all binaries from the current
# build are first candidates
# ----------
PATH
=
$CHKDIR
/bin:
$PATH
export
PATH
# ----------
# Run initdb to initialize a database system in ./tmp_check
# ----------
echo
"=============== Initializing check database instance ================"
initdb
--pglib
=
$LIBDIR
--pgdata
=
$PGDATA
>
$LOGDIR
/initdb.log 2>&1
if
[
$?
-ne
0
]
then
echo
""
echo
"ERROR: Check installation failed - cannot continue"
echo
"Please examine
$LOGDIR
/initdb.log"
echo
"for the errors occured."
echo
""
exit
3
fi
# ----------
# Start a postmaster for the check instance and give
# him some time to pass the WAL recovery code.
#----------
echo
"=============== Starting regression postmaster ================"
postmaster
-D
$PGDATA
-p
$PGPORT
-o
-F
>
$LOGDIR
/postmaster.log 2>&1 &
PMPID
=
$!
sleep
2
if
!
kill
-0
$PMPID
>
/dev/null 2>&1
then
echo
""
echo
"ERROR: Regression postmaster did not startup."
echo
"Please examing
$LOGDIR
/postmaster.log"
echo
"for the errors occured."
echo
""
exit
4
fi
echo
"Regression postmaster is running - PID=
$PMPID
PGPORT=
$PGPORT
"
# ----------
# Create the regression database
# ----------
echo
"=============== Creating regression database... ================"
if
[
-n
"
$MULTIBYTE
"
]
;
then
mbtests
=
`
echo
$MULTIBYTE
|
tr
"[A-Z]"
"[a-z]"
`
PGCLIENTENCODING
=
"
$MULTIBYTE
"
export
PGCLIENTENCODING
ENCODINGOPT
=
"-E
$MULTIBYTE
"
else
mbtests
=
""
unset
PGCLIENTENCODING
ENCODINGOPT
=
""
fi
createdb
$ENCODINGOPT
$HOST
regression
if
[
$?
-ne
0
]
;
then
echo
createdb failed
kill
-15
$PMPID
exit
1
fi
# ----------
# Install the PL/pgSQL language in it
# ----------
echo
"=============== Installing PL/pgSQL... ================"
createlang
$HOST
plpgsql regression
if
[
$?
-ne
0
-a
$?
-ne
2
]
;
then
echo
createlang failed
kill
-15
$PMPID
exit
1
fi
# ----------
# Run the regression tests specified in the ./sql/run_check.tests file
# ----------
echo
"=============== Running regression queries... ================"
echo
""
>
regression.diffs
echo
""
>
regress.out
TESTS
=
./sql/run_check.tests
lno
=
0
(
cat
$TESTS
for
name
in
$extratests
;
do
echo
"test
$name
"
done
)
|
while
read
line
;
do
# ----------
# Count line numbers and skip comments and empty lines
# ----------
lno
=
`
expr
$lno
+ 1
`
line
=
`
echo
$line
|
sed
-e
's/[ ]*#.*//'
`
if
[
-z
"
$line
"
]
then
continue
fi
# ----------
# Extract the type keyword and the name
# ----------
type
=
`
echo
$line
|
awk
'{print $1;}'
`
name
=
`
echo
$line
|
awk
'{print $2;}'
`
case
$type
in
parallel
)
# ----------
# This is the beginning of a new group of
# tests that should be executed parallel.
# ----------
parlist
=
parlno
=
$lno
pargroup
=
$name
parntests
=
0
parpar
=
0
while
read
line
;
do
# ----------
# Again count line numbers and skip comments
# ----------
lno
=
`
expr
$lno
+ 1
`
line
=
`
echo
$line
|
sed
-e
's/[ ]*#.*//'
`
if
[
-z
"
$line
"
]
then
continue
fi
# ----------
# Collect and count the number of tests to
# execute parallel
# ----------
type
=
`
echo
$line
|
awk
'{print $1;}'
`
name
=
`
echo
$line
|
awk
'{print $2;}'
`
if
[
"
$type
"
=
"endparallel"
]
then
parend
=
1
break
fi
if
[
"
$type
"
=
"parallel"
]
then
echo
""
echo
"
$TESTS
line
$lno
: parallel cannot be nested"
echo
""
exit
5
fi
if
[
"
$type
"
!=
"test"
]
then
echo
""
echo
"
$TESTS
line
$lno
: syntax error"
echo
""
exit
5
fi
if
[
!
-z
"
$parlist
"
]
then
parlist
=
"
$parlist
"
fi
parlist
=
"
${
parlist
}
$name
"
parntests
=
`
expr
$parntests
+ 1
`
done
# ----------
# Check that we found a matching 'endparallel'
# ----------
if
[
$parend
-eq
0
]
then
echo
""
echo
"
$TESTS
at EOF: missing endparallel for line
$parlno
"
echo
""
exit
5
fi
# ----------
# Tell what we're doing and start them all inside a
# subshell in background. The bourne shell's wait is
# too dumb to do it smarter. I'd really like to see
# the ok|failed message as soon as the individual tests
# finish. That'd make it easier to start longer running
# ones first to increase concurrency.
# ----------
gnam
=
`
echo
"
$pargroup
(
$parntests
tests)"
|
awk
'{printf "%-26.26s", $line;}'
`
$ECHO_N
"parallel
$gnam
... "
$ECHO_C
(
for
name
in
$parlist
;
do
$FRONTEND
regression < sql/
${
name
}
.sql
\
>
results/
${
name
}
.out 2>&1
done
wait
)
# ----------
# Setup status information for the diff check below
# ----------
checklist
=
$parlist
checkpname
=
1
echo
"done"
;;
test
)
# ----------
# This is a test that must be executed serialized
# ----------
pnam
=
`
echo
$name
|
awk
'{printf "%-20.20s", $1;}'
`
$ECHO_N
"sequential test
$pnam
... "
$ECHO_C
$FRONTEND
regression < sql/
${
name
}
.sql
\
>
results/
${
name
}
.out 2>&1
# ----------
# Setup status information for the diff check below
# ----------
checklist
=
$name
checkpname
=
0
;;
*
)
# ----------
# And this is space for extensions
# ----------
echo
""
echo
"
$TESTS
line
$lno
: syntax error"
echo
""
exit
5
;;
esac
# ----------
# One single or a group of parallel tests has been completed.
# Check the output against the expected results.
#
# On the fly we create run_check.out and regress.out in the
# old format, so checkresults will still find the proper
# information.
# ----------
for
name
in
$checklist
;
do
if
[
$checkpname
-ne
0
]
then
pnam
=
`
echo
$name
|
awk
'{printf "%-20.20s", $1;}'
`
$ECHO_N
" test
$pnam
... "
$ECHO_C
fi
if
[
-f
expected/
${
name
}
-
${
SYSTEM
}
.out
]
then
EXPECTED
=
"expected/
${
name
}
-
${
SYSTEM
}
.out"
else
EXPECTED
=
"expected/
${
name
}
.out"
fi
if
[
`
diff
-w
${
EXPECTED
}
results/
${
name
}
.out |
wc
-l
`
-ne
0
]
then
(
diff
-wC3
${
EXPECTED
}
results/
${
name
}
.out
;
\
echo
""
;
\
echo
"----------------------"
;
\
echo
""
;
\
)
>>
regression.diffs
echo
"FAILED"
echo
"
$name
.. failed"
>>
regress.out
else
echo
"ok"
echo
"
$name
.. ok"
>>
regress.out
fi
done
done
|
tee
run_check.out 2>&1
# ----------
# Finally kill the postmaster we started
# ----------
echo
"=============== Terminating regression postmaster ================"
kill
-15
$PMPID
exit
0
src/test/regress/sql/numeric.sql
View file @
43499af4
This diff is collapsed.
Click to expand it.
src/test/regress/sql/run_check.tests
0 → 100644
View file @
43499af4
# ----------
# The first group of parallel test
# ----------
parallel group1
test boolean
test char
test name
test varchar
test text
test int2
test int4
test int8
test oid
test float4
test float8
endparallel
test strings # Depends on things setup during char, varchar and text.
# ----------
# The second group of parallel test
# ----------
parallel group2
test numerology
test point
test lseg
test box
test path
test polygon
test circle
test timespan
test datetime
test reltime
test tinterval
test inet
test comments
test oidjoins
test type_sanity
test opr_sanity
endparallel
test abstime # Depends on the reltime test
test horology # Depends on timespan, datetime, reltime and abstime
test geometry # Depends on point, lseg, box, path, polygon and circle
# ----------
# These four each depend on the previous one
# ----------
test create_function_1
test create_type
test create_table
test create_function_2
# ----------
# Load huge amounts of data
# We should split the data files into single files and then
# execute two copy tests parallel, to check that copy itself
# is concurrent safe.
# ----------
test copy
# ----------
# The third group of parallel test
# ----------
parallel group3
test constraints
test triggers
test create_misc
test create_aggregate
test create_operator
test create_index
endparallel
test create_view # Depends on the above
# ----------
# sanity_check does a vacuum, affecting the sort order of SELECT *
# results. So it should not run parallel to other tests.
# ----------
test sanity_check
# ----------
# Believe it or not, select creates a table, subsequent
# tests need.
# ----------
test errors
test select
# ----------
# The fourth group of parallel test
# ----------
parallel group4
test select_into
test select_distinct
test select_distinct_on
test select_implicit
test select_having
test subselect
test union
test case
test join
test aggregates
test transactions
test random
test portals
test arrays
test btree_index
test hash_index
endparallel
test misc
# ----------
# The fifth group of parallel test
# ----------
parallel group5
test select_views
test alter_table
test portals_p2
test rules
endparallel
# ----------
# The sixth group of parallel test
# ----------
parallel group6
test limit
test plpgsql # Cannot run concurrently to rules
test temp
test numeric
endparallel
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment