projects
/
users
/
simon
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0972328
)
Fixed copy&paste mistake that made library use uninitialized variable.
author
Michael Meskes
<
[email protected]
>
Tue, 3 Feb 2009 08:48:29 +0000
(08:48 +0000)
committer
Michael Meskes
<
[email protected]
>
Tue, 3 Feb 2009 08:48:29 +0000
(08:48 +0000)
src/interfaces/ecpg/ecpglib/execute.c
patch
|
blob
|
blame
|
history
diff --git
a/src/interfaces/ecpg/ecpglib/execute.c
b/src/interfaces/ecpg/ecpglib/execute.c
index 193848b36708a4dda55e9f0c6e56f607e5281962..86978ee3116888da4c7b77d992721df49380fb02 100644
(file)
--- a/
src/interfaces/ecpg/ecpglib/execute.c
+++ b/
src/interfaces/ecpg/ecpglib/execute.c
@@
-391,7
+391,11
@@
ecpg_store_result(const PGresult *results, int act_field,
}
}
else
- len = PQgetlength(results, act_tuple, act_field);
+ {
+ for (act_tuple = 0; act_tuple < ntuples; act_tuple++)
+ len += strlen(PQgetvalue(results, act_tuple, act_field)) + 1;
+ }
+
ecpg_log("ecpg_store_result on line %d: allocating memory for %d tuples\n", stmt->lineno, ntuples);
var->value = (char *) ecpg_alloc(len, stmt->lineno);
if (!var->value)