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
149f01c4
Commit
149f01c4
authored
Aug 06, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ecpg thread testing file.
parent
630684d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
13 deletions
+83
-13
src/interfaces/ecpg/compatlib/Makefile
src/interfaces/ecpg/compatlib/Makefile
+3
-3
src/interfaces/ecpg/pgtypeslib/Makefile
src/interfaces/ecpg/pgtypeslib/Makefile
+2
-2
src/interfaces/ecpg/preproc/Makefile
src/interfaces/ecpg/preproc/Makefile
+3
-3
src/interfaces/ecpg/test/Makefile
src/interfaces/ecpg/test/Makefile
+5
-5
src/interfaces/ecpg/test/test_thread.pgc
src/interfaces/ecpg/test/test_thread.pgc
+70
-0
No files found.
src/interfaces/ecpg/compatlib/Makefile
View file @
149f01c4
...
...
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.
7 2003/08/01 16:18:04 petere
Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.
8 2003/08/06 02:19:48 momjian
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -16,8 +16,8 @@ NAME= ecpg_compat
SO_MAJOR_VERSION
=
1
SO_MINOR_VERSION
=
0
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
SHLIB_LINK
=
-L
../pgtypeslib
-lpgtypes
-L
../ecpglib
-lecpg
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
$(THREAD_CFLAGS)
SHLIB_LINK
=
-L
../pgtypeslib
-lpgtypes
-L
../ecpglib
-lecpg
$(THREAD_LIBS)
OBJS
=
informix.o
...
...
src/interfaces/ecpg/pgtypeslib/Makefile
View file @
149f01c4
...
...
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.
9 2003/08/01 16:18:04 petere
Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.
10 2003/08/06 02:19:51 momjian
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -16,7 +16,7 @@ NAME= pgtypes
SO_MAJOR_VERSION
=
1
SO_MINOR_VERSION
=
0
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS) -g
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
$(THREAD_CFLAGS)
-g
OBJS
=
numeric.o datetime.o common.o dt_common.o timestamp.o interval.o
\
$(
filter
rint.o,
$(LIBOBJS)
)
...
...
src/interfaces/ecpg/preproc/Makefile
View file @
149f01c4
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.9
2 2003/06/15 04:07:58
momjian Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.9
3 2003/08/06 02:19:51
momjian Exp $
subdir
=
src/interfaces/ecpg/preproc
top_builddir
=
../../../..
...
...
@@ -8,7 +8,7 @@ MAJOR_VERSION=3
MINOR_VERSION
=
0
PATCHLEVEL
=
0
override CPPFLAGS
:
= -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS)
\
override CPPFLAGS
:
= -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS)
$(THREAD_CFLAGS)
\
-DMAJOR_VERSION=$(MAJOR_VERSION)
\
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL)
\
-DINCLUDE_PATH=
\"
$(includedir)
\"
...
...
@@ -24,7 +24,7 @@ OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.o\
all
:
submake-libpgport ecpg
ecpg
:
$(OBJS)
$(CC)
$(CFLAGS)
$(LDFLAGS)
$^
$(LIBS)
-o
$@
$(CC)
$(CFLAGS)
$(LDFLAGS)
$^
$(LIBS)
$(THREAD_LIBS)
-o
$@
# pgc is compiled as part of preproc
preproc.o
:
$(srcdir)/pgc.c
...
...
src/interfaces/ecpg/test/Makefile
View file @
149f01c4
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/test/Makefile,v 1.
39 2003/08/01 13:53:36 petere
Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/test/Makefile,v 1.
40 2003/08/06 02:19:51 momjian
Exp $
subdir
=
src/interfaces/ecpg/test
top_builddir
=
../../../..
include
$(top_builddir)/src/Makefile.global
override CPPFLAGS
:
= -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS)
override CPPFLAGS
:
= -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS)
$(THREAD_CFLAGS)
ECPG
=
../preproc/ecpg
-I
$(srcdir)
/../include
TESTS
=
test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init testdynalloc num_test dt_test test_informix
TESTS
=
test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init testdynalloc num_test dt_test test_informix
test_thread
all
:
$(TESTS)
%
:
%.o
$(CC)
$(CFLAGS)
$(LDFLAGS)
-L
../ecpglib
-L
../pgtypeslib
-L
../../libpq
$^
$(LIBS)
-lpgtypes
-lecpg
-lpq
-o
$@
$(CC)
$(CFLAGS)
$(LDFLAGS)
-L
../ecpglib
-L
../pgtypeslib
-L
../../libpq
$^
$(LIBS)
-lpgtypes
-lecpg
-lpq
$(THREAD_LIBS)
-o
$@
test_informix
:
test_informix.o
$(CC)
$(CFLAGS)
$(LDFLAGS)
-L
../compatlib
-L
../ecpglib
-L
../pgtypeslib
-L
../../libpq
$^
$(LIBS)
-lpgtypes
-lecpg
-lecpg_compat
-lpq
-o
$@
$(CC)
$(CFLAGS)
$(LDFLAGS)
-L
../compatlib
-L
../ecpglib
-L
../pgtypeslib
-L
../../libpq
$^
$(LIBS)
-lpgtypes
-lecpg
-lecpg_compat
-lpq
$(THREAD_LIBS)
-o
$@
%.c
:
%.pgc
$(ECPG)
$<
...
...
src/interfaces/ecpg/test/test_thread.pgc
0 → 100644
View file @
149f01c4
/* ---
* Thread test program
* by Philip Yarra
*
* To run, create this table in the 'test' database:
*
* CREATE TABLE foo (
* message character(40)
* );
* ---
*/
#include <pthread.h>
int main(void);
void ins1(void);
void ins2(void);
int main(void)
{
pthread_t thread1, thread2;
pthread_create(&thread1, NULL, (void *) ins1, NULL);
pthread_create(&thread2, NULL, (void *) ins2, NULL);
pthread_join(thread1, NULL);
pthread_join(thread2, NULL);
printf("Program done!\n");
return 0;
}
void ins1(void)
{
int i;
EXEC SQL BEGIN DECLARE SECTION;
char* cs = "test";
char* bar = "one!";
EXEC SQL END DECLARE SECTION;
EXEC SQL WHENEVER sqlerror sqlprint;
EXEC SQL CONNECT TO :cs AS test1;
for (i = 0; i < 5; i++)
{
printf("thread 1 : inserting\n");
EXEC SQL AT test1 INSERT INTO foo VALUES(:bar);
printf("thread 1 : insert done\n");
}
EXEC SQL AT test1 COMMIT WORK;
EXEC SQL DISCONNECT test1;
printf("thread 1 : done!\n");
}
void ins2(void)
{
int i;
EXEC SQL BEGIN DECLARE SECTION;
char* cs = "test";
char* bar = "two!";
EXEC SQL END DECLARE SECTION;
EXEC SQL WHENEVER sqlerror sqlprint;
EXEC SQL CONNECT TO :cs AS test2;
for (i = 0; i < 5; i++)
{
printf("thread 2: inserting\n");
EXEC SQL AT test2 INSERT INTO foo VALUES(:bar);
printf("thread 2: insert done\n");
}
EXEC SQL AT test2 COMMIT WORK;
EXEC SQL DISCONNECT test2;
printf("thread 2: done!\n");
}
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