summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-04-03Bump version to 5.22.5v5.22.5Damien Regad2-3/+3
2023-04-03Update ChangelogDamien Regad1-2/+42
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-03-25Remove useless variables and commentsDamien Regad1-14/+4
2023-03-25WhitespaceDamien Regad1-27/+12
2023-03-25PHPDocDamien Regad1-98/+206
2023-03-25Move MySQL BINARY to expression right-hand sideDamien Regad1-5/+6
Having it on the left-hand side prevented usage of the index, so a full table scan was performed with significant performance impact when a large number of sessions are stored in the table. Fixes #941
2023-03-25Fix inconsistent DB provider check in ADODB_SessionDamien Regad1-10/+43
Introduce a new class property to store the database provider, populated when opening the connection, and handling the PDO drivers specificities. New isConnectionMysql() and isConnectionPostgres() methods are replacing tests against $conn->dataProvider or ADODB_Session::driver(), ensuring a consistent check of the database type. Fixes #943
2023-03-20Fix invalid markdown in 5.20.16 changelogDamien Regad1-2/+2
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-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-17trim(): Passing null to parameter #1 is deprecatedDamien Regad1-1/+2
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 Regad2-3/+18
2023-03-17Remove safe mode referencesDamien Regad2-7/+4
safe_mode was deprecated in PHP 5.3 and removed in 5.4. This removes remaining references to it in the code. Fixes #934
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 Regad10-15/+90
- 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 Regad6-15/+23
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-12Allow dynamic properties for ADOFieldObject classDamien Regad1-1/+5
Fixes #906
2023-03-12PHPDoc add variable type hintDamien Regad1-0/+1
Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-03-12Define ADORecordSet::$insertSigDamien Regad1-0/+2
Fixes PHP 8.2 Deprecated warning: Creation of dynamic property. Fixes #908 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-03-12Define ADORecordSet::$tableNameDamien Regad1-0/+6
Fixes PHP 8.2 Deprecated warning: Creation of dynamic property. Fixes #909 Signed-off-by: Damien Regad <dregad@mantisbt.org>
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 Regad3-2/+14
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 Regad8-28/+24
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-01-19Update ChangelogDamien Regad1-0/+7
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)
2023-01-17Improve autoExecute() PHPDoc, fix $where param typeDamien Regad1-18/+16
$where was wrongly typed as bool. Changed it to string and updated the default value from false to ''. Fixes #915
2023-01-16Use IF NOT EXISTS when adding a new column Ioannis Igoumenos1-1/+2
Executing a schema update that adds a column more than once will generate a column already exists error. This prevents the error by appending `IF NOT EXISTS` to the generated SQL on PostgreSQL 9.6 or later. Fixes #897 Signed-off-by: Damien Regad <dregad@mantisbt.org> Reworded commit message
2022-11-23Bump version to 5.22.5-devDamien Regad2-1/+10
2022-11-23ADODB_FETCH_DEFAULT should be treated as ASSOCMark Newnham1-3/+1
Ensures that the recordset is returned in the default provided by the PHP driver as per the documentation. Fixes #886
2022-10-28Bump version to 5.22.4v5.22.4Damien Regad2-2/+2
2022-10-28Update ChangelogDamien Regad1-0/+4
2022-10-28mysqli: store error msg/code after query executionDamien Regad1-8/+20
ADOConnection's errorNo() and errorMsg() methods were returning 0 / '' when executing an SQL statement with bound parameters, since the introduction of true prepared statements (in #655). This is because they are getting error information from the mysqli connection object, but when using prepared statements, it must be retrieved from the mysqli_stmt object. Fixes #872
2022-10-28Ignore .DS_Store filesDamien Regad1-0/+1
2022-10-28affected_rows() returns false when called incorrectlyMark Newnham1-3/+5
If called incorrectly, the affected_rows() method now returns false instead of returning an error from the SQL server driver. Fixes #895
2022-09-09Update ChangelogDamien Regad1-0/+4
2022-09-09Don't strip ORDER BY clause from subqueriesDamien Regad1-3/+7
adodb_strip_order_by() should only remove the ORDER BY clause from the outer SELECT statement, not from subqueries. Fixes #870
2022-09-09Add PHPUnit cache files to .gitignoreDamien Regad1-0/+4
2022-09-09Test case for adodb_strip_order_by()Damien Regad1-0/+45
2022-09-09Refactor adodb_strip_order_by()Damien Regad1-25/+13
The replacement of preg_match() by preg_match_all() in commit 8eaf842d19e4206e1c44e0eda44688ebfa1728ed basically made most of the code in the function useless (the block parsing the SQL statement for paretheses was never called). Also, the logic to retrieve the last ORDER BY clause was a bit contrived. Fixes #869
2022-09-08Fix mysqli_result could not be converted to intDamien Regad2-3/+7
Partial revert of 721c31492ac77aa1bd9bdd01193cd6071087b49f. This was an early attempt to fix #848; the actual fix was implemented in the PostgreSQL driver, but the change to ADORecordSet::__destruct() was not reverted. Fixes #867
2022-09-08Bump version to 5.22.4-devDamien Regad2-1/+4
2022-09-07Update ChangelogDamien Regad1-0/+1
https://github.com/ADOdb/ADOdb/issues/124#issuecomment-1238798400
2022-09-06Bump version to 5.22.3v5.22.3Damien Regad2-3/+3
2022-09-06Update ChangelogDamien Regad1-0/+3