pike.git/
lib/
modules/
Sql.pmod/
pgsql_util.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-05-01
2018-05-01 09:01:31 by Stephen R. van den Berg <srb@cuci.nl>
57c80fe4f99ae02284244f0a192fbd91c72c3ec7 (
21
lines) (+
15
/-
6
)
[
Show
|
Annotate
]
Branch:
8.0
pgsql: Make affected_rows() and status_command_complete() wait for a meaningful result.
749:
//! Returns the command-complete status for this query. //!
-
//!
@seealso
-
//!
@[affected_
rows
()]
+
//!
@note
+
//!
This method should normally be called after EOF has been reached.
+
//! If it is called before, all unfetched result
rows
will be discarded.
//! //! @note //! This function is PostgreSQL-specific.
-
+
//!
+
//! @[affected_rows()], @[eof()]
/*semi*/final string status_command_complete() {
-
+
if (!statuscmdcomplete)
+
while (fetch_row_array());
return statuscmdcomplete; } //! Returns the number of affected rows by this query. //!
-
//!
@seealso
-
//!
@[status_command_complete()]
+
//!
@note
+
//!
This method should normally be called after EOF has been reached.
+
//! If it is called before, all unfetched result rows will be discarded.
//! //! @note //! This function is PostgreSQL-specific.
-
+
//!
+
//! @seealso
+
//! @[status_command_complete()], @[eof()]
/*semi*/final int affected_rows() { int rows;
-
if (statuscmdcomplete)
-
sscanf(
statuscmdcomplete
, "%*s %d %d", rows, rows);
+
sscanf
(
status_command_complete(
), "%*s %d %d", rows, rows);
return rows; }