提交 7ff8a180 编写于 作者: M Michael Meskes

*** empty log message ***

上级 d9e4966b
......@@ -700,3 +700,8 @@ Fri Oct 29 21:36:25 CEST 1999
- Fixed bug that caused ecpg to not allow FOR UPDATE.
- Set ecpg version to 2.6.9
Mon Nov 1 11:22:06 CET 1999
- Print SQL error message to STDERR instead of STDOUT.
- Added a fourth test source.
- Set library version to 3.0.5.
......@@ -6,13 +6,13 @@
# Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.49 1999/10/13 11:38:35 momjian Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.50 1999/11/02 12:11:53 meskes Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 0.4
SO_MINOR_VERSION= 0.5
SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global
......
......@@ -1294,7 +1294,7 @@ void
sqlprint(void)
{
sqlca.sqlerrm.sqlerrmc[sqlca.sqlerrm.sqlerrml] = '\0';
printf("sql error %s\n", sqlca.sqlerrm.sqlerrmc);
fprintf(stderr, "sql error %s\n", sqlca.sqlerrm.sqlerrmc);
}
static bool
......
all: test1 test2 test3 perftest
all: test1 test2 test3 test4 perftest
LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq -lcrypt
test1: test1.c
test1.c: test1.pgc
/usr/local/pgsql/bin/ecpg $?
.SUFFIXES: .pgc .c
test1: test1.c
test2: test2.c
test2.c: test2.pgc
/usr/local/pgsql/bin/ecpg $?
test3: test3.c
test3.c: test3.pgc
/usr/local/pgsql/bin/ecpg $?
test4: test4.c
perftest: perftest.c
perftest.c:perftest.pgc
.pgc.c:
/usr/local/pgsql/bin/ecpg $?
clean:
-/bin/rm test1 test2 test3 perftest *.c log
-/bin/rm test1 test2 test3 test4 perftest *.c log
exec sql include sqlca;
exec sql whenever sqlerror
do
PrintAndStop();
exec sql whenever sqlwarning
do
warn();
exec sql whenever sqlerror do PrintAndStop(msg);
exec sql whenever sqlwarning do warn();
void PrintAndStop(void)
void PrintAndStop(msg)
{
fprintf(stderr, "Error in statement '%s':\n", msg);
sqlprint();
exit(-1);
}
void warn(void)
void warn(void)
{
fprintf(stderr, "Warning: At least one column was truncated\n");
}
exec sql whenever sqlerror sqlprint;
exec sql include header_test;
exec sql include sqlca;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册