Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3e4978b7
Commit
3e4978b7
authored
Oct 17, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix free-slot search in PgSetResultId so it actually works.
parent
e313eb80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
src/interfaces/libpgtcl/pgtclId.c
src/interfaces/libpgtcl/pgtclId.c
+14
-10
No files found.
src/interfaces/libpgtcl/pgtclId.c
View file @
3e4978b7
...
...
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.3
6 2002/09/23 01:43:23 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.3
7 2002/10/17 14:53:32 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -340,30 +340,34 @@ PgSetResultId(Tcl_Interp *interp, char *connid_c, PGresult *res)
return
TCL_ERROR
;
connid
=
(
Pg_ConnectionId
*
)
Tcl_GetChannelInstanceData
(
conn_chan
);
for
(
resid
=
connid
->
res_last
+
1
;
resid
!=
connid
->
res_last
;
resid
++
)
/* search, starting at slot after the last one used */
resid
=
connid
->
res_last
;
for
(;;)
{
if
(
resid
==
connid
->
res_max
)
{
/* advance, with wraparound */
if
(
++
resid
>=
connid
->
res_max
)
resid
=
0
;
break
;
}
/* this slot empty? */
if
(
!
connid
->
results
[
resid
])
{
connid
->
res_last
=
resid
;
break
;
break
;
/* success exit */
}
/* checked all slots? */
if
(
resid
==
connid
->
res_last
)
break
;
/* failure exit */
}
if
(
connid
->
results
[
resid
])
{
if
(
connid
->
res_max
==
connid
->
res_hardmax
)
/* no free slot found, so try to enlarge array */
if
(
connid
->
res_max
>=
connid
->
res_hardmax
)
{
Tcl_SetResult
(
interp
,
"hard limit on result handles reached"
,
TCL_STATIC
);
return
TCL_ERROR
;
}
connid
->
res_last
=
connid
->
res_max
;
resid
=
connid
->
res_max
;
connid
->
res_last
=
resid
=
connid
->
res_max
;
connid
->
res_max
*=
2
;
if
(
connid
->
res_max
>
connid
->
res_hardmax
)
connid
->
res_max
=
connid
->
res_hardmax
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment