summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2023-10-18Remove remaining ADOdb date/time function callsJoe Bordes9-23/+19
This is a follow-up on commit bffa42e206d758af3095b8a0bdbf3c3ad8fb5e51. Following removal of adodb-time library, some function calls were not cleaned up in the code base. This fixes that. Includes a standalone test script to validate the functionality. Fixes #970 (PR #1002)
2023-07-25Merge branch 'hotfix/5.22'Damien Regad1-27/+27
2023-07-25Remove unnecessary is_array() checkDamien Regad1-23/+22
2023-07-25oci8: deprecation warning in selecLimit() on PHP 8.1wesyah2341-4/+5
'Automatic conversion of false to array is deprecated' warning is triggered when $inputarr parameter is not provided (defaulted to false). Fixes #992
2023-06-12Merge branch 'hotfix/5.22'Damien Regad1-1/+1
# Conflicts: # adodb.inc.php # docs/changelog.md
2023-06-12Update ADODB_db2::_query() declaration to match parentDamien Regad1-1/+1
Regression from ae2438b731d24bf0bb159a738599b9266120e96e. Fixes #987
2023-06-11Merge branch 'hotfix/5.22'Damien Regad2-4/+24
2023-06-11PR #779 follow-upDamien Regad1-6/+12
- Add missing global var declaration - Coding guidelines - Comment usage of @ operator - Update changelog
2023-06-11pgsql: avoid Insert_ID() failing when lastval() is not setNathan Gibbs1-5/+11
If Insert_ID() is executed before nextval() has been called in the current session, SELECT lastval() will fail with `ERROR: lastval is not yet defined in this session`. When using Exceptions, this causes one to be thrown but this is not the expected behavior, as the function is expected to just return false in this case. Fixes #978 Signed-off-by: Damien Regad <dregad@mantisbt.org> Rewritten commit message
2023-06-10Incorrect ADORecordset::$fetchMode initializationDamien Regad9-13/+9
Regression introduced by 5c9e24cf98409004da2a5e5bd80eeec82c5a3997 For some drivers using native fetch mode constants, the $fetchMode property was not set properly as the switch statement assigning its value was driven by the constructor's $mode parameter instead of the parent constructor's $adodbFetchMode property. Fixes #980
2023-05-24Fail connection if mysqlnd is not availableDamien Regad1-0/+8
Since 5.22.0, the mysqli driver relies on the mysqli_stmt_get_result() function, which is only available in the MySQL Native Driver, to execute queries. An attempt to connect on a system using libmysqlclient should fail with an error message, to avoid problems down the line. Fixes #967
2023-05-22Merge branch 'hotfix/5.22'Damien Regad4-4/+7
2023-05-22Remove incorrect usage of reference operator (&)Damien Regad1-6/+6
2023-05-22WhitespaceDamien Regad1-3/+1
2023-05-22Set $fetchMode property in ADORecordSet constructorDamien Regad21-210/+68
This reduces code duplication as the logic to initialize $fetchMode from $ADODB_FETCH_MODE global was repeated in most drivers. $adodbFetchMode is systematically initialized as well now; previously it was only set in those drivers having specific fetch modes. Fixes #958
2023-05-22Coding guidelinesDamien Regad3-4/+4
2023-05-22PHPDoc: ADODB_mysqli::setCharSet() is deprecatedDamien Regad1-0/+3
As mentioned in the documentation [1], function is deprecated for MySQL databases since version 5.21. [1]: https://adodb.org/dokuwiki/doku.php?id=v5:reference:connection:setcharset
2023-05-18Merge branch 'hotfix/5.22'Damien Regad20-81/+66
2023-04-30WhitespaceDamien Regad3-8/+8
2023-04-30Define ADOConnection::_query() methodDamien Regad20-53/+58
- Update child classes to be consistent with this declaration. - Remove unnecessary, non-PHPDoc comments - Consistent parameter names Fixes #966
2023-04-30PHPDoc: fix ADOConnection::execute() return typeDamien Regad2-20/+0
Remove redundant PHPDoc block in child classes ADODB_mysqli, ADODB_oci8. Fixes #964
2023-04-18Remove no longer used noBlobs variableMike1-1/+0
Fixes #961
2023-04-16Merge branch 'hotfix/5.22'Damien Regad1-1/+3
2023-04-16Fix deprecated warning in ADODB_postgres64::qStr()Damien Regad1-1/+3
pg_escape_string() will trigger a deprecation warning in PHP 8.1+ when there is no connection specified. This can occur when using setSessionVariables() in the load balancer, so we fall back to emulated escaping in this case. Fixes #956
2023-04-15Remove legacy workarounds for old pgsql versionsMike1-17/+1
- Nested SQL (v7.1) - 'set bytea_output=escape' (v9.0 to 9.2) Fixes #950 Co-authored-by: Mike-Benoit <mikeb@timetrex.com>
2023-04-03Fix exception when executing empty SQL on PHP 8Damien Regad1-0/+8
When calling execute() with an empty SQL query on MySQL, PHP throws an Exception: ValueError: mysqli_query(): Argument #2 ($query) cannot be empty We now check that $sql is not empty, and if it is just return false. Fixes #945 Back-ported from commit 8c57976eaf2f4cf9a71cc7fb88edb1d7b90b00ce. # Conflicts: # drivers/adodb-mysqli.inc.php
2023-04-03Fix exception when executing empty SQL on PHP 8Damien Regad1-0/+8
When calling execute() with an empty SQL query on MySQL, PHP throws an Exception: ValueError: mysqli_query(): Argument #2 ($query) cannot be empty We now check that $sql is not empty, and if it is just return false. Fixes #945
2023-04-02Merge branch 'hotfix/5.22'Damien Regad1-3/+5
2023-03-20PDO bind support both '?'-style and named parametersToru Okugawa (Tanaka)1-5/+66
- bind parameter conversion behavior is selectable with $bindParameterStyle property and associated BIND_USE_* constants - default style is BIND_USE_BOTH - outputs a message in debug mode to warn about performance Fixes #880
2023-03-20Fix PHP warning in ADODB_postgres64::MetaIndexes()Damien Regad1-3/+5
When calling the function on a table having an index on an expression column, a PHP warning is thrown: Undefined array key 0 in ./drivers/adodb-postgres64.inc.php on line 666 Fixes #940
2023-03-17Merge branch 'hotfix/5.22'Damien Regad13-67/+71
2023-03-17oci8: remove usage of undefined $seqField propertyDamien Regad1-4/+0
This fixes PHP 8.2 deprecation notice. Fixes #933
2023-03-17PDO firebird: remove unnecessary methodsDamien Regad1-14/+0
- _init() did not actually initialize anything useful, as the $pdoDriver property was not used anywhere. - _affectedrows() was likely introduced by mistake (copy/paste error when the driver was refactored in 2019), as it references Firebird native (non-PDO) function fbird_affected_rows(), as discussed in #935. This fixes PHP 8.2 deprecation warnings due to undefined properties.
2023-03-17Move setTransactionMode() to ADODB_pdo_sqlsrv classDamien Regad1-11/+12
Method was previously in ADORecordSet_array_pdo_sqlsrv class, which does not make sense. Originally added in #349 (bdbacb2735af011009e42b21f9908cb8cf986579). Fixes #939
2023-03-17Fix static analysis warningsDamien Regad2-9/+16
- beginTrans() override is not needed, as it's just calling the parent - define $_connectionID and $_queryID in PDO base classes and add PHPDoc blocks to set property's type as appropriate - Also add PHPDoc with type to $_driver property
2023-03-17Revert "postgres: Noblob optimization"Damien Regad1-2/+1
This reverts commit 84a7122ae93b82238c6c37bd81d483c632e8b50c (PR #112) The ADOConnection object does not have a 'connection' property, and the 'noBlobs' flag is not documented or used anywhere else. The change's original contributor never provided any feedback [1], and usage of the undefined property is now throwing a deprecation warning on PHP 8.2. [1]: https://github.com/ADOdb/ADOdb/pull/112#issuecomment-902028719
2023-03-17PHPDocDamien Regad1-0/+3
2023-03-17Replace obsolete function aliasDamien Regad1-1/+2
oci_free_cursor() alias was deprecated in PHP 5.4 and replaced by oci_free_statement() [1]. Fixes #937 [1]: https://www.php.net/manual/en/function.ocifreecursor.php
2023-03-17Fix PHP 8.2 dynamic properties deprecation warningsDamien Regad5-14/+21
- ADOConnection: add $_metars, $locale, $metaColumnsSQL, $identitySQL, $_genSeqSQL, $_dropSeqSQL and $_genIDSQL; add PHPDoc to $metaDatabasesSQL $metaTablesSQL - Exceptions: add $msg property - DB2: reference parent connection object and fix $_queryID case - Informix: don't cache version info in SetVersion - odbtp: define $odbc_name, $_canSelectDb, $_lastAffectedRows properties NOTE: this is somewhat academical as the driver is obsolete - oci8: define $_refcursor property - sybase: use existing $hasTransactions property instead of $_hastrans - text: rename unused ADOConnection::$_evalAll property to $evalAll - perf: define $settings property - xml: add properties dbTable::$currentPlatform, dbTable::$data, dbData::$current_field, adoSchema:$obj This is adapted from changes proposed in #926
2023-03-17Define ADOConnection::$connectStmtDamien Regad5-15/+19
Adapt the few drivers that were previously using this property. Fixes dynamic properties deprecation in PHP 8.2 Based on original submission in PR #926
2023-03-12Merge branch 'hotfix/5.22'Damien Regad9-29/+16
# Conflicts: # adodb.inc.php
2023-03-12Remove useless property overridesDamien Regad2-2/+0
ADOConnection::$adodbFetchMode is redeclared in Postgres and PDO drivers but this is not necessary. See #923 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-03-12Fix PHP 8.2 deprecation warnings + PHPDoc fixesDamien Regad1-2/+2
Cherry picked from commits feadc3df1fdb199bbef50eb404f81b7d78f94c79 and 5e41924806e5f310d30e203100f0c97cd5e93893. # Conflicts: # adodb.inc.php Creation of dynamic property - ADORecordset_sqlite3::$adodbFetchMode in adodb-sqlite3.inc.php (#911) - ADOFieldObject::$scale in adodb-sqlite3.inc.php (#912) Partially-supported callable - in adodb-pdo-inc.php (#928)
2023-03-12Remove deprecated $databaseName propertyDamien Regad7-27/+16
ADOConnection::$databaseName was marked as obsolete in ADOdb 4.66. Since the assignment that was kept for backwards-compatibility in the ADOConnection::selectDB() method is causing deprecation warnings with PHP 8.2, now is the time to get rid of it. The 2018 rewrite of DB2 driver introduced a private $databaseName property; this has been removed in favor of ADOConnection::$database. Fixes #932, #904 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-03-12Fix PHP 8.2 deprecation warningsMark Newnham1-2/+2
Creation of dynamic property - ADORecordset_sqlite3::$adodbFetchMode in adodb-sqlite3.inc.php (#911) - ADOFieldObject::$scale in adodb-sqlite3.inc.php (#912) Partially-supported callable - in adodb-pdo-inc.php (#928) --------- This is a re-do of fa572e96d20ac233e9dfc2d8f770234475381107 (PR #921) with an improved commit message. Co-authored-by: raortegar <raquel.ortega@moodle.com> Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-03-12Revert commit fa572e96d20ac233e9dfc2d8f770234475381107Damien Regad1-2/+2
Nothing wrong with the code changes, but the commit message is bit of a mess, so I'll re-apply it after rewording.
2023-02-25912 sqlite deprecated creation of dynamic property adofieldobject%24scale is ↵Mark Newnham1-2/+2
deprecated in driversadodb sqlite3incphp on line 194 (#931) * Fixed Partially-supported callable are deprecated in PHP 8.2 * Fix deprecated undefined property #912 #911 #920 #923 --------- Co-authored-by: raortegar <raquel.ortega@moodle.com>
2023-01-19Merge branch 'hotfix/5.22'Damien Regad1-1/+2
2023-01-19Fix PHP 8.2 compatibility issues for PDO driverPeter Deed1-1/+2
Creation of dynamic property is deprecated - Line 605 - ADODB_pdo::$_stmt - Line 788 - ADORecordSet_pdo::$adodbFetchMode PR #917 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-01-19PHP 8.2 fixes for PostgreSQL driverReimuHakurei1-0/+4
Fixes #913 (PR #920) (cherry picked from commit 14a4a5a47805f152f56205c1ab4ae9ce98de5ad1)