From 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:45:02 +0100 Subject: initial checking of customized version 1.0rc9 --- .../adodb/adodb-php/drivers/adodb-mysqlpo.inc.php | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php (limited to 'vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php') diff --git a/vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php b/vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php new file mode 100644 index 0000000..1cc7a91 --- /dev/null +++ b/vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php @@ -0,0 +1,128 @@ + + + This driver extends the deprecated mysql driver, and was originally designed to be a + portable driver in the same manner as oci8po and mssqlpo. Its functionality + is exactly duplicated in the mysqlt driver, which is itself deprecated. + This driver will be removed in ADOdb version 6.0.0. + + Requires mysql client. Works on Windows and Unix. +*/ + +// security - hide paths +if (!defined('ADODB_DIR')) die(); + +include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php"); + + +class ADODB_mysqlt extends ADODB_mysql { + var $databaseType = 'mysqlt'; + var $ansiOuter = true; // for Version 3.23.17 or later + var $hasTransactions = true; + var $autoRollback = true; // apparently mysql does not autorollback properly + + function __construct() + { + global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_'; + } + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + $this->Execute('SET AUTOCOMMIT=0'); + $this->Execute('BEGIN'); + return true; + } + + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + if (!$ok) return $this->RollbackTrans(); + + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('COMMIT'); + $this->Execute('SET AUTOCOMMIT=1'); + return true; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('ROLLBACK'); + $this->Execute('SET AUTOCOMMIT=1'); + return true; + } + + function RowLock($tables,$where='',$col='1 as adodbignore') + { + if ($this->transCnt==0) $this->BeginTrans(); + if ($where) $where = ' where '.$where; + $rs = $this->Execute("select $col from $tables $where for update"); + return !empty($rs); + } + +} + +class ADORecordSet_mysqlt extends ADORecordSet_mysql{ + var $databaseType = "mysqlt"; + + function __construct($queryID,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + + switch ($mode) + { + case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; + case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; + + case ADODB_FETCH_DEFAULT: + case ADODB_FETCH_BOTH: + default: $this->fetchMode = MYSQL_BOTH; break; + } + + $this->adodbFetchMode = $mode; + parent::__construct($queryID); + } + + function MoveNext() + { + if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) { + $this->_currentRow += 1; + return true; + } + if (!$this->EOF) { + $this->_currentRow += 1; + $this->EOF = true; + } + return false; + } +} + +class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt { + + function __construct($queryID,$mode=false) + { + parent::__construct($queryID,$mode); + } + + function MoveNext() + { + return adodb_movenext($this); + } +} -- cgit v1.2.3-54-g00ecf