summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Newnham <mark@newnhams.com>2021-03-27 18:48:52 -0600
committerDamien Regad <dregad@mantisbt.org>2021-08-22 11:16:01 +0200
commitd1539539c583e961e5c1ba189a9ffb5082344f37 (patch)
tree9aa01cee8e7597475e65c89b7dd37834e46c4a4b
parent19d676c7440ce535ec1047927ef7493eb04473b1 (diff)
downloadadodb-d1539539c583e961e5c1ba189a9ffb5082344f37.tar.gz
adodb-d1539539c583e961e5c1ba189a9ffb5082344f37.tar.bz2
adodb-d1539539c583e961e5c1ba189a9ffb5082344f37.zip
update method errorNo()
Error no is derived from fbird_errcode, isnstead of attempting to parse it from the errorMessage
-rw-r--r--drivers/adodb-firebird.inc.php25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/adodb-firebird.inc.php b/drivers/adodb-firebird.inc.php
index bfeeaa22..d628784e 100644
--- a/drivers/adodb-firebird.inc.php
+++ b/drivers/adodb-firebird.inc.php
@@ -414,7 +414,7 @@ class ADODB_firebird extends ADOConnection {
*
* @return bool|int|string
*/
- function GenID($seqname='adodbseq',$startID=1)
+ public function genID($seqname='adodbseq',$startID=1)
{
$getnext = ("SELECT Gen_ID($seqname,1) FROM RDB\$DATABASE");
$rs = @$this->Execute($getnext);
@@ -441,15 +441,17 @@ class ADODB_firebird extends ADOConnection {
return false;
}
+
function _handleerror()
{
- $this->_errorMsg = fbird_errmsg();
+ $this->_errorCode = fbird_errcode();
+ $this->_errorMsg = fbird_errmsg();
}
- function ErrorNo()
+
+ public function errorNo()
{
- if (preg_match('/error code = ([\-0-9]*)/i', $this->_errorMsg,$arr)) return (integer) $arr[1];
- else return 0;
+ return (integer) $this->_errorCode;
}
function ErrorMsg()
@@ -457,7 +459,18 @@ class ADODB_firebird extends ADOConnection {
return $this->_errorMsg;
}
- function Prepare($sql)
+ /**
+ * Prepares an SQL statement and returns a handle to use.
+ * This is not used by bound parameters anymore
+ *
+ * @link https://adodb.org/dokuwiki/doku.php?id=v5:reference:connection:prepare
+ * @todo update this function to handle prepared statements correctly
+ *
+ * @param string $sql The SQL to prepare.
+ *
+ * @return string The original SQL that was provided.
+ */
+ public function prepare($sql)
{
$stmt = fbird_prepare($this->_connectionID,$sql);
if (!$stmt) return false;