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

Commitf417ebf

Browse files
author
Michael Meskes
committed
- Check for NULL before checking whether argument is an array.
- Remove stary character from string quoting. - Fixed check to report missing varchar pointer implementation.
1 parent9012bb6 commitf417ebf

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,6 +1929,12 @@ Thu Jun 2 14:22:32 CEST 2005
19291929
- Fixed memory leak in ecpglib by adding some missing free() commands.
19301930
- Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit
19311931
hardware.
1932+
1933+
Wed Aug 24 12:17:48 CEST 2005
1934+
1935+
- Check for NULL before checking whether argument is an array.
1936+
- Removed stray character from string quoting.
1937+
- Fixed check to report missing varchar pointer implementation.
19321938
- Set ecpg library version to 5.1.
19331939
- Set ecpg version to 4.1.1.
19341940

‎src/interfaces/ecpg/ecpglib/data.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.27 2004/08/29 05:06:59 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.28 2005/08/24 10:34:19 meskes Exp $ */
22

33
#definePOSTGRES_ECPG_INTERNAL
44
#include"postgres_fe.h"
@@ -50,29 +50,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
5050

5151
ECPGlog("ECPGget_data line %d: RESULT: %s offset: %ld array: %s\n",lineno,pval ?pval :"",offset,isarray ?"Yes" :"No");
5252

53-
/* pval is a pointer to the value */
54-
/* let's check if it really is an array if it should be one */
55-
if (isarray==ECPG_ARRAY_ARRAY)
56-
{
57-
if (*pval!='{')
58-
{
59-
ECPGraise(lineno,ECPG_DATA_NOT_ARRAY,ECPG_SQLSTATE_DATATYPE_MISMATCH,NULL);
60-
return (false);
61-
}
62-
63-
switch (type)
64-
{
65-
caseECPGt_char:
66-
caseECPGt_unsigned_char:
67-
caseECPGt_varchar:
68-
break;
69-
70-
default:
71-
pval++;
72-
break;
73-
}
74-
}
75-
7653
/* We will have to decode the value */
7754

7855
/*
@@ -129,6 +106,29 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
129106
if (value_for_indicator==-1)
130107
return (true);
131108

109+
/* pval is a pointer to the value */
110+
/* let's check if it really is an array if it should be one */
111+
if (isarray==ECPG_ARRAY_ARRAY)
112+
{
113+
if (*pval!='{')
114+
{
115+
ECPGraise(lineno,ECPG_DATA_NOT_ARRAY,ECPG_SQLSTATE_DATATYPE_MISMATCH,NULL);
116+
return (false);
117+
}
118+
119+
switch (type)
120+
{
121+
caseECPGt_char:
122+
caseECPGt_unsigned_char:
123+
caseECPGt_varchar:
124+
break;
125+
126+
default:
127+
pval++;
128+
break;
129+
}
130+
}
131+
132132
do
133133
{
134134
switch (type)

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.309 2005/08/22 20:25:03 momjian Exp $*/
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.310 2005/08/24 10:34:19 meskes Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -5144,7 +5144,8 @@ variable: opt_pointer ECPGColLabel opt_array_bounds opt_initializer
51445144
*dim ='\0';
51455145
else
51465146
sprintf(dim,"[%s]", dimension);
5147-
if (strcmp(length,"0") ==0)
5147+
/* if (strcmp(length, "0") == 0)*/
5148+
if (atoi(length) <=0)
51485149
mmerror(PARSE_ERROR, ET_ERROR,"pointer to varchar are not implemented");
51495150

51505151
if (strcmp(dimension,"0") ==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp