mirror of
https://github.com/postgres/postgres.git
synced 2025-05-18 17:41:14 +03:00
Applied all bug fixes from head also to 7.4. Just bugfixes, no new features.
This commit is contained in:
parent
9c09764783
commit
96cee3f12a
@ -1714,3 +1714,17 @@ Mon Nov 3 15:43:19 CET 2003
|
|||||||
- Set pgtypes library to 1.0.0
|
- Set pgtypes library to 1.0.0
|
||||||
- Set compat library to 1.0.0
|
- Set compat library to 1.0.0
|
||||||
|
|
||||||
|
Wed Dec 3 09:45:21 CET 2003
|
||||||
|
|
||||||
|
- Added patch for array handling by Dave Cramer
|
||||||
|
|
||||||
|
Wed Dec 17 16:11:16 CET 2003
|
||||||
|
|
||||||
|
- Added just another patch by Dave that fixes a reversed order in
|
||||||
|
variable listing for output variables in cursor definitions
|
||||||
|
- Fixed incorrect if call in long=>numeric conversion.
|
||||||
|
- Set ecpg version to 3.1.0
|
||||||
|
- Set ecpg library to 4.1.0
|
||||||
|
- Set pgtypes library to 1.1.0
|
||||||
|
- Set compat library to 1.1.0
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 1994, Regents of the University of California
|
# Copyright (c) 1994, Regents of the University of California
|
||||||
#
|
#
|
||||||
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.11 2003/10/28 21:55:58 tgl Exp $
|
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.11.2.1 2003/12/17 15:31:51 meskes Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
|
|||||||
|
|
||||||
NAME= ecpg_compat
|
NAME= ecpg_compat
|
||||||
SO_MAJOR_VERSION= 1
|
SO_MAJOR_VERSION= 1
|
||||||
SO_MINOR_VERSION= 0
|
SO_MINOR_VERSION= 1
|
||||||
|
|
||||||
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) $(THREAD_CPPFLAGS)
|
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) $(THREAD_CPPFLAGS)
|
||||||
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
|
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 1994, Regents of the University of California
|
# Copyright (c) 1994, Regents of the University of California
|
||||||
#
|
#
|
||||||
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.10 2003/10/28 21:55:58 tgl Exp $
|
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.10.2.1 2003/12/17 15:31:51 meskes Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
|
|||||||
|
|
||||||
NAME= ecpg
|
NAME= ecpg
|
||||||
SO_MAJOR_VERSION= 4
|
SO_MAJOR_VERSION= 4
|
||||||
SO_MINOR_VERSION= 0
|
SO_MINOR_VERSION= 1
|
||||||
|
|
||||||
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
|
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.26.2.2 2003/11/12 08:42:57 meskes Exp $ */
|
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.26.2.3 2003/12/17 15:31:51 meskes Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The aim is to get a simpler inteface to the database routines.
|
* The aim is to get a simpler inteface to the database routines.
|
||||||
@ -314,7 +314,11 @@ ECPGis_type_an_array(int type, const struct statement * stmt, const struct varia
|
|||||||
sprintf(array_query, "select typlen from pg_type where oid=%d and typelem<>0", type);
|
sprintf(array_query, "select typlen from pg_type where oid=%d and typelem<>0", type);
|
||||||
query = PQexec(stmt->connection->connection, array_query);
|
query = PQexec(stmt->connection->connection, array_query);
|
||||||
ECPGfree(array_query);
|
ECPGfree(array_query);
|
||||||
if (PQresultStatus(query) == PGRES_TUPLES_OK)
|
if (PQresultStatus(query) == PGRES_TUPLES_OK )
|
||||||
|
{
|
||||||
|
if ( PQntuples(query) == 0 )
|
||||||
|
isarray = ECPG_ARRAY_NONE;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
isarray = (atol((char *) PQgetvalue(query, 0, 0)) == -1) ? ECPG_ARRAY_ARRAY : ECPG_ARRAY_VECTOR;
|
isarray = (atol((char *) PQgetvalue(query, 0, 0)) == -1) ? ECPG_ARRAY_ARRAY : ECPG_ARRAY_VECTOR;
|
||||||
if (ECPGDynamicType(type) == SQL3_CHARACTER ||
|
if (ECPGDynamicType(type) == SQL3_CHARACTER ||
|
||||||
@ -326,6 +330,7 @@ ECPGis_type_an_array(int type, const struct statement * stmt, const struct varia
|
|||||||
isarray = ECPG_ARRAY_NONE;
|
isarray = ECPG_ARRAY_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
PQclear(query);
|
PQclear(query);
|
||||||
ECPGtypeinfocache_push(&(stmt->connection->cache_head), type, isarray, stmt->lineno);
|
ECPGtypeinfocache_push(&(stmt->connection->cache_head), type, isarray, stmt->lineno);
|
||||||
ECPGlog("ECPGexecute line %d: TYPE database: %d C: %d array: %d\n", stmt->lineno, type, var->type, isarray);
|
ECPGlog("ECPGexecute line %d: TYPE database: %d C: %d array: %d\n", stmt->lineno, type, var->type, isarray);
|
||||||
@ -353,7 +358,7 @@ ECPGstore_result(const PGresult *results, int act_field,
|
|||||||
{
|
{
|
||||||
ECPGlog("ECPGexecute line %d: Incorrect number of matches: %d don't fit into array of %d\n",
|
ECPGlog("ECPGexecute line %d: Incorrect number of matches: %d don't fit into array of %d\n",
|
||||||
stmt->lineno, ntuples, var->arrsize);
|
stmt->lineno, ntuples, var->arrsize);
|
||||||
ECPGraise(stmt->lineno, ECPG_TOO_MANY_MATCHES, ECPG_SQLSTATE_CARDINALITY_VIOLATION, NULL);
|
ECPGraise(stmt->lineno, INFORMIX_MODE(stmt->compat)?ECPG_INFORMIX_SUBSELECT_NOT_ONE:ECPG_TOO_MANY_MATCHES, ECPG_SQLSTATE_CARDINALITY_VIOLATION, NULL);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 1994, Regents of the University of California
|
# Copyright (c) 1994, Regents of the University of California
|
||||||
#
|
#
|
||||||
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.13 2003/10/03 17:04:48 tgl Exp $
|
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.13.2.1 2003/12/17 15:31:51 meskes Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
|
|||||||
|
|
||||||
NAME= pgtypes
|
NAME= pgtypes
|
||||||
SO_MAJOR_VERSION= 1
|
SO_MAJOR_VERSION= 1
|
||||||
SO_MINOR_VERSION= 0
|
SO_MINOR_VERSION= 1
|
||||||
|
|
||||||
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
|
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
|
||||||
SHLIB_LINK += -lm
|
SHLIB_LINK += -lm
|
||||||
|
@ -1353,7 +1353,7 @@ PGTYPESnumeric_from_long(signed long int long_val, numeric *var)
|
|||||||
reach_limit *= 10;
|
reach_limit *= 10;
|
||||||
} while ((reach_limit - 1) < abs_long_val && reach_limit <= LONG_MAX/10);
|
} while ((reach_limit - 1) < abs_long_val && reach_limit <= LONG_MAX/10);
|
||||||
|
|
||||||
if (reach_limit <= LONG_MAX/10)
|
if (reach_limit > LONG_MAX/10)
|
||||||
{
|
{
|
||||||
/* add the first digit and a .0 */
|
/* add the first digit and a .0 */
|
||||||
size += 2;
|
size += 2;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.94 2003/09/27 15:32:48 momjian Exp $
|
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.94.2.1 2003/12/17 15:31:51 meskes Exp $
|
||||||
|
|
||||||
subdir = src/interfaces/ecpg/preproc
|
subdir = src/interfaces/ecpg/preproc
|
||||||
top_builddir = ../../../..
|
top_builddir = ../../../..
|
||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
|
||||||
MAJOR_VERSION=3
|
MAJOR_VERSION=3
|
||||||
MINOR_VERSION=0
|
MINOR_VERSION=1
|
||||||
PATCHLEVEL=0
|
PATCHLEVEL=0
|
||||||
|
|
||||||
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) \
|
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) \
|
||||||
|
@ -75,8 +75,8 @@ extern void add_descriptor(char *, char *);
|
|||||||
extern void drop_descriptor(char *, char *);
|
extern void drop_descriptor(char *, char *);
|
||||||
extern struct descriptor *lookup_descriptor(char *, char *);
|
extern struct descriptor *lookup_descriptor(char *, char *);
|
||||||
extern struct variable *descriptor_variable(const char *name, int input);
|
extern struct variable *descriptor_variable(const char *name, int input);
|
||||||
extern void add_variable(struct arguments **, struct variable *, struct variable *);
|
extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
|
||||||
extern void append_variable(struct arguments **, struct variable *, struct variable *);
|
extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
|
||||||
extern void dump_variables(struct arguments *, int);
|
extern void dump_variables(struct arguments *, int);
|
||||||
extern struct typedefs *get_typedef(char *);
|
extern struct typedefs *get_typedef(char *);
|
||||||
extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int);
|
extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.263.2.2 2003/11/19 13:19:40 meskes Exp $ */
|
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.263.2.3 2003/12/17 15:31:51 meskes Exp $ */
|
||||||
|
|
||||||
/* Copyright comment */
|
/* Copyright comment */
|
||||||
%{
|
%{
|
||||||
@ -271,12 +271,12 @@ add_additional_variables(char *name, bool insert)
|
|||||||
/* add all those input variables that were given earlier
|
/* add all those input variables that were given earlier
|
||||||
* note that we have to append here but have to keep the existing order */
|
* note that we have to append here but have to keep the existing order */
|
||||||
for (p = ptr->argsinsert; p; p = p->next)
|
for (p = ptr->argsinsert; p; p = p->next)
|
||||||
append_variable(&argsinsert, p->variable, p->indicator);
|
add_variable_to_tail(&argsinsert, p->variable, p->indicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add all those output variables that were given earlier */
|
/* add all those output variables that were given earlier */
|
||||||
for (p = ptr->argsresult; p; p = p->next)
|
for (p = ptr->argsresult; p; p = p->next)
|
||||||
add_variable(&argsresult, p->variable, p->indicator);
|
add_variable_to_tail(&argsresult, p->variable, p->indicator);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
@ -4385,7 +4385,7 @@ ECPGCursorStmt: DECLARE name cursor_options CURSOR opt_hold FOR prepared_name
|
|||||||
sprintf(thisquery->name, "ECPGprepared_statement(%s)", $7);
|
sprintf(thisquery->name, "ECPGprepared_statement(%s)", $7);
|
||||||
|
|
||||||
this->argsinsert = NULL;
|
this->argsinsert = NULL;
|
||||||
add_variable(&(this->argsinsert), thisquery, &no_indicator);
|
add_variable_to_head(&(this->argsinsert), thisquery, &no_indicator);
|
||||||
|
|
||||||
cur = this;
|
cur = this;
|
||||||
|
|
||||||
@ -5211,7 +5211,7 @@ ECPGExecute : EXECUTE IMMEDIATE execstring
|
|||||||
thisquery->next = NULL;
|
thisquery->next = NULL;
|
||||||
thisquery->name = $3;
|
thisquery->name = $3;
|
||||||
|
|
||||||
add_variable(&argsinsert, thisquery, &no_indicator);
|
add_variable_to_head(&argsinsert, thisquery, &no_indicator);
|
||||||
|
|
||||||
$$ = make_str("?");
|
$$ = make_str("?");
|
||||||
}
|
}
|
||||||
@ -5225,7 +5225,7 @@ ECPGExecute : EXECUTE IMMEDIATE execstring
|
|||||||
thisquery->name = (char *) mm_alloc(sizeof("ECPGprepared_statement()") + strlen($2));
|
thisquery->name = (char *) mm_alloc(sizeof("ECPGprepared_statement()") + strlen($2));
|
||||||
sprintf(thisquery->name, "ECPGprepared_statement(%s)", $2);
|
sprintf(thisquery->name, "ECPGprepared_statement(%s)", $2);
|
||||||
|
|
||||||
add_variable(&argsinsert, thisquery, &no_indicator);
|
add_variable_to_head(&argsinsert, thisquery, &no_indicator);
|
||||||
}
|
}
|
||||||
execute_rest
|
execute_rest
|
||||||
{
|
{
|
||||||
@ -5270,14 +5270,14 @@ ecpg_using: USING using_list { $$ = EMPTY; }
|
|||||||
|
|
||||||
using_descriptor: USING opt_sql SQL_DESCRIPTOR quoted_ident_stringvar
|
using_descriptor: USING opt_sql SQL_DESCRIPTOR quoted_ident_stringvar
|
||||||
{
|
{
|
||||||
add_variable(&argsresult, descriptor_variable($4,0), &no_indicator);
|
add_variable_to_head(&argsresult, descriptor_variable($4,0), &no_indicator);
|
||||||
$$ = EMPTY;
|
$$ = EMPTY;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
into_descriptor: INTO opt_sql SQL_DESCRIPTOR quoted_ident_stringvar
|
into_descriptor: INTO opt_sql SQL_DESCRIPTOR quoted_ident_stringvar
|
||||||
{
|
{
|
||||||
add_variable(&argsresult, descriptor_variable($4,0), &no_indicator);
|
add_variable_to_head(&argsresult, descriptor_variable($4,0), &no_indicator);
|
||||||
$$ = EMPTY;
|
$$ = EMPTY;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -5301,7 +5301,7 @@ UsingConst: AllConst
|
|||||||
char *length = mm_alloc(32);
|
char *length = mm_alloc(32);
|
||||||
|
|
||||||
sprintf(length, "%d", (int) strlen($1));
|
sprintf(length, "%d", (int) strlen($1));
|
||||||
add_variable(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator);
|
add_variable_to_head(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -6147,9 +6147,9 @@ c_args: /*EMPTY*/ { $$ = EMPTY; }
|
|||||||
;
|
;
|
||||||
|
|
||||||
coutputvariable: CVARIABLE indicator
|
coutputvariable: CVARIABLE indicator
|
||||||
{ add_variable(&argsresult, find_variable($1), find_variable($2)); }
|
{ add_variable_to_head(&argsresult, find_variable($1), find_variable($2)); }
|
||||||
| CVARIABLE
|
| CVARIABLE
|
||||||
{ add_variable(&argsresult, find_variable($1), &no_indicator); }
|
{ add_variable_to_head(&argsresult, find_variable($1), &no_indicator); }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -6158,14 +6158,14 @@ civarind: CVARIABLE indicator
|
|||||||
if (find_variable($2)->type->type == ECPGt_array)
|
if (find_variable($2)->type->type == ECPGt_array)
|
||||||
mmerror(PARSE_ERROR, ET_ERROR, "arrays of indicators are not allowed on input");
|
mmerror(PARSE_ERROR, ET_ERROR, "arrays of indicators are not allowed on input");
|
||||||
|
|
||||||
add_variable(&argsinsert, find_variable($1), find_variable($2));
|
add_variable_to_head(&argsinsert, find_variable($1), find_variable($2));
|
||||||
$$ = create_questionmarks($1, false);
|
$$ = create_questionmarks($1, false);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
civar: CVARIABLE
|
civar: CVARIABLE
|
||||||
{
|
{
|
||||||
add_variable(&argsinsert, find_variable($1), &no_indicator);
|
add_variable_to_head(&argsinsert, find_variable($1), &no_indicator);
|
||||||
$$ = create_questionmarks($1, false);
|
$$ = create_questionmarks($1, false);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
@ -299,7 +299,7 @@ remove_variables(int brace_level)
|
|||||||
prevvar->next = varptr->next;
|
prevvar->next = varptr->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (varptr = ptr->argsresult; varptr != NULL; varptr = varptr->next)
|
for (varptr = prevvar = ptr->argsresult; varptr != NULL; varptr = varptr->next)
|
||||||
{
|
{
|
||||||
if (p == varptr->variable)
|
if (p == varptr->variable)
|
||||||
{
|
{
|
||||||
@ -349,7 +349,7 @@ reset_variables(void)
|
|||||||
* Note: The list is dumped from the end,
|
* Note: The list is dumped from the end,
|
||||||
* so we have to add new entries at the beginning */
|
* so we have to add new entries at the beginning */
|
||||||
void
|
void
|
||||||
add_variable(struct arguments ** list, struct variable * var, struct variable * ind)
|
add_variable_to_head(struct arguments ** list, struct variable * var, struct variable * ind)
|
||||||
{
|
{
|
||||||
struct arguments *p = (struct arguments *) mm_alloc(sizeof(struct arguments));
|
struct arguments *p = (struct arguments *) mm_alloc(sizeof(struct arguments));
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ add_variable(struct arguments ** list, struct variable * var, struct variable *
|
|||||||
|
|
||||||
/* Append a new variable to our request list. */
|
/* Append a new variable to our request list. */
|
||||||
void
|
void
|
||||||
append_variable(struct arguments ** list, struct variable * var, struct variable * ind)
|
add_variable_to_tail(struct arguments ** list, struct variable * var, struct variable * ind)
|
||||||
{
|
{
|
||||||
struct arguments *p,
|
struct arguments *p,
|
||||||
*new = (struct arguments *) mm_alloc(sizeof(struct arguments));
|
*new = (struct arguments *) mm_alloc(sizeof(struct arguments));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user