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

Commitdf389d1

Browse files
committed
Approaching the current documentation from a position of ignorance, I
find it ambiguous. I propose something along the lines of thefollowing patch to clarify it. Thanks.(Alternatively, perhaps the code could maintain a count of nestedcalls to SPI_connect/SPI_finish. But I didn't try to write thatpatch.)Ian Lance Taylor
1 parent941139b commitdf389d1

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

‎doc/src/sgml/spi.sgml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ using <Acronym>SPI</Acronym>.
3434
</Para>
3535

3636
<Para>
37-
<Acronym>SPI</Acronym> procedures are always called by some (upper)
38-
Executor and the <Acronym>SPI</Acronym>
39-
manager uses the Executor to run your queries. Other procedures may be
40-
called by the Executor running queries from your procedure.
37+
Procedures which use <Acronym>SPI</Acronym> are called by the
38+
Executor. The <Acronym>SPI</Acronym> calls recursively invoke the
39+
Executor in turn to run queries. When the Executor is invoked
40+
recursively, it may itself call procedures which may make
41+
<Acronym>SPI</Acronym> calls.
4142
</Para>
4243

4344
<Para>
@@ -146,12 +147,17 @@ Return status
146147
utility SPI functions may be called from un-connected procedures.
147148
</PARA>
148149
<PARA>
149-
You may get <ReturnValue>SPI_ERROR_CONNECT</ReturnValue> error if <Function>SPI_connect</Function> is
150-
called from an already connected procedure - e.g. if you directly call one
151-
procedure from another connected one. Actually, while the child procedure
152-
will be able to use SPI, your parent procedure will not be able to continue
153-
to use SPI after the child returns (if <Function>SPI_finish</Function> is called by the child).
154-
It's bad practice.
150+
If your procedure is already connected,
151+
<Function>SPI_connect</Function> will return an
152+
<ReturnValue>SPI_ERROR_CONNECT</ReturnValue> error. Note that this
153+
may happen if a procedure which has called
154+
<Function>SPI_connect</Function> directly calls another procedure
155+
which itself calls <Function>SPI_connect</Function>. While
156+
recursive calls to the <Acronym>SPI</Acronym> manager are permitted
157+
when an <Acronym>SPI</Acronym> query invokes another function which
158+
uses <Acronym>SPI</Acronym>, directly nested calls to
159+
<Function>SPI_connect</Function> and
160+
<Function>SPI_finish</Function> are forbidden.
155161
</PARA>
156162
</REFSECT1>
157163
<REFSECT1 ID="R1-SPI-SPICONNECT-2">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp