Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7886d73

Browse files
author
Bryan Henderson
committed
Fix perbyte_cpu thing
1 parent 4b2b859 commit 7886d73

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/backend/commands/define.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.7 1996/11/08 05:55:49 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.8 1996/11/08 06:24:58 bryanh Exp $
1313
*
1414
* DESCRIPTION
1515
* The "DefineFoo" routines take the parse tree and pick out the
@@ -117,8 +117,6 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
117117
*outin_ratio_p = OUTIN_RATIO;
118118

119119
foreach(pl, (List *)parameters) {
120-
int count;
121-
char *ptr;
122120
ParamString *param = (ParamString*)lfirst(pl);
123121

124122
if (strcasecmp(param->name, "iscachable") == 0) {
@@ -136,14 +134,17 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
136134
*/
137135
*byte_pct_p = atoi(param->val);
138136
} else if (strcasecmp(param->name, "perbyte_cpu") == 0) {
139-
count = 0;
140137
if (sscanf(param->val, "%d", perbyte_cpu_p) == 0) {
138+
int count;
139+
char *ptr;
141140
for (ptr = param->val; *ptr != '\0'; ptr++)
142141
if (*ptr == '!') count++;
142+
*perbyte_cpu_p = (int) pow(10.0, (double) count);
143143
}
144-
*perbyte_cpu_p = (int) pow(10.0, (double) count);
145144
} else if (strcasecmp(param->name, "percall_cpu") == 0) {
146145
if (sscanf(param->val, "%d", percall_cpu_p) == 0) {
146+
int count;
147+
char *ptr;
147148
for (count = 0, ptr = param->val; *ptr != '\0'; ptr++)
148149
if (*ptr == '!') count++;
149150
*percall_cpu_p = (int) pow(10.0, (double) count);

0 commit comments

Comments
 (0)