summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Newnham <mark@newnhams.com>2020-05-31 18:57:48 -0600
committerMark Newnham <mark@newnhams.com>2020-05-31 18:57:48 -0600
commit76145bb52f0cc1c659f08574fede3183ee3135ae (patch)
tree5add506704e6af58c977675df4940e60d6aca7b8
parentc47e5c272e98a06e1c92248b5d9d1ae0afe71c97 (diff)
downloadadodb-76145bb52f0cc1c659f08574fede3183ee3135ae.tar.gz
adodb-76145bb52f0cc1c659f08574fede3183ee3135ae.tar.bz2
adodb-76145bb52f0cc1c659f08574fede3183ee3135ae.zip
Retrieve error messages early before connection close #614
Error messages from last error are lost if the connection is closed before retrieval
-rw-r--r--drivers/adodb-mssqlnative.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php
index 53be16ce..1f48a32f 100644
--- a/drivers/adodb-mssqlnative.inc.php
+++ b/drivers/adodb-mssqlnative.inc.php
@@ -1080,6 +1080,12 @@ class ADORecordset_mssqlnative extends ADORecordSet {
is running. All associated result memory for the specified result identifier will automatically be freed. */
function _close()
{
+ /*
+ * If we are closing down a failed query, collect any
+ * error messages. This is a hack fix to the "close too early"
+ * problem so this might go away later
+ */
+ $this->connection->errorMsg();
if(is_resource($this->_queryID)) {
$rez = sqlsrv_free_stmt($this->_queryID);
$this->_queryID = false;