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

Commit95eea2d

Browse files
author
Michael Meskes
committed
- 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.
1 parent845109e commit95eea2d

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,12 @@ Mon Nov 3 15:43:19 CET 2003
17171717
Wed Dec 3 09:45:21 CET 2003
17181718

17191719
- Added patch for array handling by Dave Cramer
1720+
1721+
Wed Dec 17 16:11:16 CET 2003
1722+
1723+
- Added just another patch by Dave that fixes a reversed order in
1724+
variable listing for output variables in cursor definitions
1725+
- Fixed incorrect if call in long=>numeric conversion.
17201726
- Set ecpg version to 3.1.0
17211727
- Set ecpg library to 4.1.0
17221728
- Set pgtypes library to 1.1.0

‎src/interfaces/ecpg/pgtypeslib/numeric.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ PGTYPESnumeric_from_long(signed long int long_val, numeric *var)
13531353
reach_limit *=10;
13541354
}while ((reach_limit-1)<abs_long_val&&reach_limit <=LONG_MAX/10);
13551355

1356-
if (reach_limit<=LONG_MAX/10)
1356+
if (reach_limit>LONG_MAX/10)
13571357
{
13581358
/* add the first digit and a .0 */
13591359
size+=2;

‎src/interfaces/ecpg/preproc/extern.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ extern void add_descriptor(char *, char *);
7575
externvoiddrop_descriptor(char*,char*);
7676
externstructdescriptor*lookup_descriptor(char*,char*);
7777
externstructvariable*descriptor_variable(constchar*name,intinput);
78-
externvoidadd_variable(structarguments**,structvariable*,structvariable*);
79-
externvoidappend_variable(structarguments**,structvariable*,structvariable*);
78+
externvoidadd_variable_to_head(structarguments**,structvariable*,structvariable*);
79+
externvoidadd_variable_to_tail(structarguments**,structvariable*,structvariable*);
8080
externvoiddump_variables(structarguments*,int);
8181
externstructtypedefs*get_typedef(char*);
8282
externvoidadjust_array(enumECPGttype,char**,char**,char*,char*,int);

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.266 2003/11/29 19:52:08 pgsql Exp $*/
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.267 2003/12/17 15:23:45 meskes Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -271,12 +271,12 @@ add_additional_variables(char *name, bool insert)
271271
/* add all those input variables that were given earlier
272272
* note that we have to append here but have to keep the existing order*/
273273
for (p = ptr->argsinsert; p; p = p->next)
274-
append_variable(&argsinsert, p->variable, p->indicator);
274+
add_variable_to_tail(&argsinsert, p->variable, p->indicator);
275275
}
276276

277277
/* add all those output variables that were given earlier*/
278278
for (p = ptr->argsresult; p; p = p->next)
279-
add_variable(&argsresult, p->variable, p->indicator);
279+
add_variable_to_tail(&argsresult, p->variable, p->indicator);
280280

281281
return ptr;
282282
}
@@ -4385,7 +4385,7 @@ ECPGCursorStmt: DECLARE name cursor_options CURSOR opt_hold FOR prepared_name
43854385
sprintf(thisquery->name,"ECPGprepared_statement(%s)", $7);
43864386

43874387
this->argsinsert =NULL;
4388-
add_variable(&(this->argsinsert), thisquery, &no_indicator);
4388+
add_variable_to_head(&(this->argsinsert), thisquery, &no_indicator);
43894389

43904390
cur =this;
43914391

@@ -5211,7 +5211,7 @@ ECPGExecute : EXECUTE IMMEDIATE execstring
52115211
thisquery->next =NULL;
52125212
thisquery->name =$3;
52135213

5214-
add_variable(&argsinsert, thisquery, &no_indicator);
5214+
add_variable_to_head(&argsinsert, thisquery, &no_indicator);
52155215

52165216
$$ = make_str("?");
52175217
}
@@ -5225,7 +5225,7 @@ ECPGExecute : EXECUTE IMMEDIATE execstring
52255225
thisquery->name = (char *) mm_alloc(sizeof("ECPGprepared_statement()") + strlen($2));
52265226
sprintf(thisquery->name,"ECPGprepared_statement(%s)", $2);
52275227

5228-
add_variable(&argsinsert, thisquery, &no_indicator);
5228+
add_variable_to_head(&argsinsert, thisquery, &no_indicator);
52295229
}
52305230
execute_rest
52315231
{
@@ -5270,14 +5270,14 @@ ecpg_using:USING using_list { $$ = EMPTY; }
52705270

52715271
using_descriptor:USINGopt_sqlSQL_DESCRIPTORquoted_ident_stringvar
52725272
{
5273-
add_variable(&argsresult, descriptor_variable($4,0), &no_indicator);
5273+
add_variable_to_head(&argsresult, descriptor_variable($4,0), &no_indicator);
52745274
$$ = EMPTY;
52755275
}
52765276
;
52775277

52785278
into_descriptor:INTOopt_sqlSQL_DESCRIPTORquoted_ident_stringvar
52795279
{
5280-
add_variable(&argsresult, descriptor_variable($4,0), &no_indicator);
5280+
add_variable_to_head(&argsresult, descriptor_variable($4,0), &no_indicator);
52815281
$$ = EMPTY;
52825282
}
52835283
;
@@ -5301,7 +5301,7 @@ UsingConst: AllConst
53015301
char *length = mm_alloc(32);
53025302

53035303
sprintf(length,"%d", (int) strlen($1));
5304-
add_variable(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator);
5304+
add_variable_to_head(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator);
53055305
}
53065306
}
53075307
;
@@ -6147,9 +6147,9 @@ c_args: /*EMPTY*/{ $$ = EMPTY; }
61476147
;
61486148

61496149
coutputvariable:CVARIABLEindicator
6150-
{add_variable(&argsresult, find_variable($1), find_variable($2)); }
6150+
{add_variable_to_head(&argsresult, find_variable($1), find_variable($2)); }
61516151
|CVARIABLE
6152-
{add_variable(&argsresult, find_variable($1), &no_indicator); }
6152+
{add_variable_to_head(&argsresult, find_variable($1), &no_indicator); }
61536153
;
61546154

61556155

@@ -6158,14 +6158,14 @@ civarind: CVARIABLE indicator
61586158
if (find_variable($2)->type->type == ECPGt_array)
61596159
mmerror(PARSE_ERROR, ET_ERROR,"arrays of indicators are not allowed on input");
61606160

6161-
add_variable(&argsinsert, find_variable($1), find_variable($2));
6161+
add_variable_to_head(&argsinsert, find_variable($1), find_variable($2));
61626162
$$ = create_questionmarks($1,false);
61636163
}
61646164
;
61656165

61666166
civar:CVARIABLE
61676167
{
6168-
add_variable(&argsinsert, find_variable($1), &no_indicator);
6168+
add_variable_to_head(&argsinsert, find_variable($1), &no_indicator);
61696169
$$ = create_questionmarks($1,false);
61706170
}
61716171
;

‎src/interfaces/ecpg/preproc/variable.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ remove_variables(int brace_level)
299299
prevvar->next=varptr->next;
300300
}
301301
}
302-
for (varptr=ptr->argsresult;varptr!=NULL;varptr=varptr->next)
302+
for (varptr=prevvar=ptr->argsresult;varptr!=NULL;varptr=varptr->next)
303303
{
304304
if (p==varptr->variable)
305305
{
@@ -349,7 +349,7 @@ reset_variables(void)
349349
* Note: The list is dumped from the end,
350350
* so we have to add new entries at the beginning */
351351
void
352-
add_variable(structarguments**list,structvariable*var,structvariable*ind)
352+
add_variable_to_head(structarguments**list,structvariable*var,structvariable*ind)
353353
{
354354
structarguments*p= (structarguments*)mm_alloc(sizeof(structarguments));
355355

@@ -361,7 +361,7 @@ add_variable(struct arguments ** list, struct variable * var, struct variable *
361361

362362
/* Append a new variable to our request list. */
363363
void
364-
append_variable(structarguments**list,structvariable*var,structvariable*ind)
364+
add_variable_to_tail(structarguments**list,structvariable*var,structvariable*ind)
365365
{
366366
structarguments*p,
367367
*new= (structarguments*)mm_alloc(sizeof(structarguments));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp