diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/adodb-ado_mssql.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-csv.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-db2.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-fbsql.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-informix72.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-mssql.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-mysql.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-mysqli.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-oci8.inc.php | 21 | ||||
| -rw-r--r-- | drivers/adodb-odbc_db2.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-odbc_mssql.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-odbtp.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-pdo.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-postgres64.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-postgres8.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-sapdb.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-sqlanywhere.inc.php | 7 | ||||
| -rw-r--r-- | drivers/adodb-sqlite.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-sqlite3.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-sybase.inc.php | 8 | ||||
| -rw-r--r-- | drivers/adodb-text.inc.php | 5 |
21 files changed, 40 insertions, 39 deletions
diff --git a/drivers/adodb-ado_mssql.inc.php b/drivers/adodb-ado_mssql.inc.php index 94f90cb0..0ae965cf 100644 --- a/drivers/adodb-ado_mssql.inc.php +++ b/drivers/adodb-ado_mssql.inc.php @@ -40,7 +40,7 @@ class ADODB_ado_mssql extends ADODB_ado { //var $_inTransaction = 1; // always open recordsets, so no transaction problems. - function _insertid() + protected function _insertID($table = '', $column = '') { return $this->GetOne('select SCOPE_IDENTITY()'); } diff --git a/drivers/adodb-csv.inc.php b/drivers/adodb-csv.inc.php index 196637b0..8261ffb8 100644 --- a/drivers/adodb-csv.inc.php +++ b/drivers/adodb-csv.inc.php @@ -38,7 +38,7 @@ class ADODB_csv extends ADOConnection { var $hasTransactions = false; var $_errorNo = false; - function _insertid() + protected function _insertID($table = '', $column = '') { return $this->_insertid; } diff --git a/drivers/adodb-db2.inc.php b/drivers/adodb-db2.inc.php index 65cd4e65..ddbc1ce0 100644 --- a/drivers/adodb-db2.inc.php +++ b/drivers/adodb-db2.inc.php @@ -92,7 +92,7 @@ class ADODB_db2 extends ADOConnection { function __construct() {} - function _insertid() + protected function _insertID($table = '', $column = '') { return ADOConnection::GetOne('VALUES IDENTITY_VAL_LOCAL()'); } diff --git a/drivers/adodb-fbsql.inc.php b/drivers/adodb-fbsql.inc.php index 3f218b69..b0c67632 100644 --- a/drivers/adodb-fbsql.inc.php +++ b/drivers/adodb-fbsql.inc.php @@ -25,7 +25,7 @@ class ADODB_fbsql extends ADOConnection { var $fmtTimeStamp = "'Y-m-d H:i:s'"; var $hasLimit = false; - function _insertid() + protected function _insertID($table = '', $column = '') { return fbsql_insert_id($this->_connectionID); } diff --git a/drivers/adodb-informix72.inc.php b/drivers/adodb-informix72.inc.php index 1ebd74ad..393ac2d3 100644 --- a/drivers/adodb-informix72.inc.php +++ b/drivers/adodb-informix72.inc.php @@ -83,7 +83,7 @@ class ADODB_informix72 extends ADOConnection { - function _insertid() + protected function _insertID($table = '', $column = '') { $sqlca =ifx_getsqlca($this->lastQuery); return @$sqlca["sqlerrd1"]; diff --git a/drivers/adodb-mssql.inc.php b/drivers/adodb-mssql.inc.php index c3133abd..f0e1be88 100644 --- a/drivers/adodb-mssql.inc.php +++ b/drivers/adodb-mssql.inc.php @@ -110,7 +110,7 @@ class ADODB_mssql extends ADOConnection { return " ISNULL($field, $ifNull) "; // if MS SQL Server } - function _insertid() + protected function _insertID($table = '', $column = '') { // SCOPE_IDENTITY() // Returns the last IDENTITY value inserted into an IDENTITY column in diff --git a/drivers/adodb-mysql.inc.php b/drivers/adodb-mysql.inc.php index 8c4612c7..b52b36ad 100644 --- a/drivers/adodb-mysql.inc.php +++ b/drivers/adodb-mysql.inc.php @@ -272,7 +272,7 @@ class ADODB_mysql extends ADOConnection { return "'" . str_replace("'", $this->replaceQuote, $s) . "'"; } - function _insertid() + protected function _insertID($table = '', $column = '') { return ADOConnection::GetOne('SELECT LAST_INSERT_ID()'); //return mysql_insert_id($this->_connectionID); diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index dfc49a37..4ed372c0 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -400,9 +400,9 @@ class ADODB_mysqli extends ADOConnection { /** * Return the AUTO_INCREMENT id of the last row that has been inserted or updated in a table. * - * @return int|string + * @inheritDoc */ - function _insertid() + protected function _insertID($table = '', $column = '') { // mysqli_insert_id does not return the last_insert_id if called after // execution of a stored procedure so we execute this instead. diff --git a/drivers/adodb-oci8.inc.php b/drivers/adodb-oci8.inc.php index 851de08d..e42d53b7 100644 --- a/drivers/adodb-oci8.inc.php +++ b/drivers/adodb-oci8.inc.php @@ -314,20 +314,19 @@ END; return " NVL($field, $ifNull) "; // if Oracle } - function _insertid($tabname,$column='') + protected function _insertID($table = '', $column = '') { if (!$this->seqField) return false; - - if ($this->schema) + if ($this->schema) { - $t = strpos($tabname,'.'); - if ($t !== false) - $tab = substr($tabname,$t+1); - else - $tab = $tabname; + $t = strpos($table,'.'); + if ($t !== false) + $tab = substr($table,$t+1); + else + $tab = $table; if ($this->useCompactAutoIncrements) $tab = sprintf('%u',crc32(strtolower($tab))); @@ -337,9 +336,9 @@ END; else { if ($this->useCompactAutoIncrements) - $tabname = sprintf('%u',crc32(strtolower($tabname))); - - $seqname = $this->seqPrefix.$tabname; + $table = sprintf('%u',crc32(strtolower($table))); + + $seqname = $this->seqPrefix.$table; } if (strlen($seqname) > 30) diff --git a/drivers/adodb-odbc_db2.inc.php b/drivers/adodb-odbc_db2.inc.php index b1da71ca..449c3568 100644 --- a/drivers/adodb-odbc_db2.inc.php +++ b/drivers/adodb-odbc_db2.inc.php @@ -131,7 +131,7 @@ class ADODB_ODBC_DB2 extends ADODB_odbc { return array('description'=>'DB2 ODBC driver', 'version'=>$vers); } - function _insertid() + protected function _insertID($table = '', $column = '') { return $this->GetOne($this->identitySQL); } diff --git a/drivers/adodb-odbc_mssql.inc.php b/drivers/adodb-odbc_mssql.inc.php index 6cb825f6..279ad386 100644 --- a/drivers/adodb-odbc_mssql.inc.php +++ b/drivers/adodb-odbc_mssql.inc.php @@ -66,7 +66,7 @@ class ADODB_odbc_mssql extends ADODB_odbc { return " ISNULL($field, $ifNull) "; // if MS SQL Server } - function _insertid() + protected function _insertID($table = '', $column = '') { // SCOPE_IDENTITY() // Returns the last IDENTITY value inserted into an IDENTITY column in diff --git a/drivers/adodb-odbtp.inc.php b/drivers/adodb-odbtp.inc.php index b15552ae..3e82b646 100644 --- a/drivers/adodb-odbtp.inc.php +++ b/drivers/adodb-odbtp.inc.php @@ -76,7 +76,7 @@ class ADODB_odbtp extends ADOConnection{ } */ - function _insertid() + protected function _insertID($table = '', $column = '') { // SCOPE_IDENTITY() // Returns the last IDENTITY value inserted into an IDENTITY column in diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php index ade9c0cf..4115658d 100644 --- a/drivers/adodb-pdo.inc.php +++ b/drivers/adodb-pdo.inc.php @@ -615,7 +615,7 @@ class ADODB_pdo extends ADOConnection { return ($this->_stmt) ? $this->_stmt->rowCount() : 0; } - function _insertid() + protected function _insertID($table = '', $column = '') { return ($this->_connectionID) ? $this->_connectionID->lastInsertId() : 0; } diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index 8fc0cbea..5a89cdb1 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -183,8 +183,10 @@ class ADODB_postgres64 extends ADOConnection{ * Using a OID as a unique identifier is not generally wise. * Unless you are very careful, you might end up with a tuple having * a different OID if a database must be reloaded. + * + * @inheritDoc */ - function _insertid($table,$column) + protected function _insertID($table = '', $column = '') { if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false; $oid = pg_last_oid($this->_resultid); diff --git a/drivers/adodb-postgres8.inc.php b/drivers/adodb-postgres8.inc.php index 15302a73..773a2d29 100644 --- a/drivers/adodb-postgres8.inc.php +++ b/drivers/adodb-postgres8.inc.php @@ -37,7 +37,7 @@ class ADODB_postgres8 extends ADODB_postgres7 * @return int last inserted ID for given table/column, or the most recently * returned one if $table or $column are empty */ - function _insertid($table, $column) + protected function _insertID($table = '', $column = '') { return empty($table) || empty($column) ? $this->GetOne("SELECT lastval()") diff --git a/drivers/adodb-sapdb.inc.php b/drivers/adodb-sapdb.inc.php index ec5f5a70..5e2f5578 100644 --- a/drivers/adodb-sapdb.inc.php +++ b/drivers/adodb-sapdb.inc.php @@ -144,7 +144,7 @@ class ADODB_SAPDB extends ADODB_odbc { } // unlike it seems, this depends on the db-session and works in a multiuser environment - function _insertid($table,$column) + protected function _insertID($table = '', $column = '') { return empty($table) ? False : $this->GetOne("SELECT $table.CURRVAL FROM DUAL"); } diff --git a/drivers/adodb-sqlanywhere.inc.php b/drivers/adodb-sqlanywhere.inc.php index 6b7e1dc2..7a5ff357 100644 --- a/drivers/adodb-sqlanywhere.inc.php +++ b/drivers/adodb-sqlanywhere.inc.php @@ -58,9 +58,10 @@ if (!defined('ADODB_SYBASE_SQLANYWHERE')){ var $databaseType = "sqlanywhere"; var $hasInsertID = true; - function _insertid() { - return $this->GetOne('select @@identity'); - } + protected function _insertID($table = '', $column = '') + { + return $this->GetOne('select @@identity'); + } function create_blobvar($blobVarName) { $this->Execute("create variable $blobVarName long binary"); diff --git a/drivers/adodb-sqlite.inc.php b/drivers/adodb-sqlite.inc.php index da2362b9..00a9aa2e 100644 --- a/drivers/adodb-sqlite.inc.php +++ b/drivers/adodb-sqlite.inc.php @@ -132,7 +132,7 @@ class ADODB_sqlite extends ADOConnection { $parentDriver->hasInsertID = true; } - function _insertid() + protected function _insertID($table = '', $column = '') { return sqlite_last_insert_rowid($this->_connectionID); } diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php index f3cf350b..ec014a47 100644 --- a/drivers/adodb-sqlite3.inc.php +++ b/drivers/adodb-sqlite3.inc.php @@ -253,7 +253,7 @@ class ADODB_sqlite3 extends ADOConnection { $parentDriver->hasInsertID = true; } - function _insertid() + protected function _insertID($table = '', $column = '') { return $this->_connectionID->lastInsertRowID(); } diff --git a/drivers/adodb-sybase.inc.php b/drivers/adodb-sybase.inc.php index 1bd47e83..ee96c0d1 100644 --- a/drivers/adodb-sybase.inc.php +++ b/drivers/adodb-sybase.inc.php @@ -44,11 +44,15 @@ class ADODB_sybase extends ADOConnection { var $port; - // might require begintrans -- committrans - function _insertid() + /** + * might require begintrans -- committrans + * @inheritDoc + */ + protected function _insertID($table = '', $column = '') { return $this->GetOne('select @@identity'); } + // might require begintrans -- committrans function _affectedrows() { diff --git a/drivers/adodb-text.inc.php b/drivers/adodb-text.inc.php index 04a451fa..ea5c16cd 100644 --- a/drivers/adodb-text.inc.php +++ b/drivers/adodb-text.inc.php @@ -97,11 +97,6 @@ class ADODB_text extends ADOConnection { return sizeof($this->_origarray); } - function _insertid() - { - return false; - } - function _affectedrows() { return false; |
