summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2022-08-26pgsql: check for dummy query Id before closing recordsetDamien Regad1-1/+1
Fixes #848
2022-08-26mssql: insert_id returns false if value is out of rangeMark Newnham1-1/+1
Insert_id() attempts to force the return value to an integer data type which fails if the value is out of range. Fixes #853
2022-07-23Apply the same fix to errorNo()Damien Regad1-4/+6
2022-07-23Fix PHP Warning when connection is already closedDamien Regad1-6/+5
If errorMsg() is called after closing the MySQL connection (with mysqli_close()), the method will throw a PHP warning: Uncaught Error: mysqli object is already closed. With PHP < 8.0 the warning won't be thrown due to the @ operator, but the function will return false; with PHP 8.0 or later, this is a fatal error (exception). Remove unnecessary @ operator. Fixes #842
2022-07-23Fix errorMsg() when no connection on MySQL 8Mark Newnham1-1/+3
MySQL 8 returns an object even if the client connection fails. This causes ADOConnection_mysqli::errorMsg(), which expects the connection object to be empty if there is no connection, to throw an error. Fixes #842
2022-06-08mysql: fix regression with portable bind arraysMark Newnham1-0/+4
The fix for issue #806 introduced a regression causing all bound SQL statements to fail in the mysqli driver, when using alphanumeric placeholders. To fix the problem, we ensure that bind array passed to mysqli bind function is numeric. Fixes #838 Signed-off-by: Damien Regad <dregad@mantisbt.org> Changes to original commit: fixed coding guidelines, improved message.
2022-06-08Prevent uncaught TypeErrormnewnham1-10/+10
Fixes #840
2022-05-09mssql: Fix undefined variable when closing connectionDamien Regad1-4/+8
Also remove redundant assignment of $this->_connectionID, which is already set to false in ADOConnection::close(). Fixes #835
2022-05-06mssql: fix undeclared variableMark Newnham1-0/+2
Prevents occurrence of PHP notice: Automatic conversion of false to array is deprecated in PHP 8.1 Fixes #829 (cherry picked from commit 40c3ed6d12354f7a83d40cd18f7bc4983dbbd33b)
2022-05-06pgsql: remove is_resource() checks (PHP 8.1 compat)ReimuHakurei2-8/+6
Affected_Rows() always returns false on PHP 8.1, because the 'pgsql result' resource has been replaced by the PgSql\Result class [1]. Changes to original contribution: * Adjust PHPDoc for ADODB_postgres64::$_resultid * Fix one more occurrence in the postgres7 driver Fixes #833 [1]: https://www.php.net/manual/en/class.pgsql-result.php Co-authored-by: Damien Regad <dregad@mantisbt.org> (cherry picked from commit e3287d6be5545634a6ccbf868919028991a68791)
2022-04-19Check for empty param array in ADODB_mysqli::execute()Damien Regad1-1/+1
Fixes #832
2022-04-03Fix affected_rows() returning falseDamien Regad1-8/+3
When an update or insert query is executed after a select query, ADODB_mysqli::$isSelectStatement is not reset causing subsequent calls to affected_rows() to return false instead of the expected number of rows. This was marked as fixed in 5.22.1 [1], but in fact it wasn't so the Changelog has been updated accordingly. Fixes #820 [1]: see commit aa88f92f95454fdfda3c4a916f7aac68c74c19a3
2022-03-29Remove unnecessary codeDamien Regad1-5/+0
2022-03-29oci8: fix PHP 8.1 array deprecation warningMark Newnham1-0/+5
Stop PHP 8.1 issuing deprecation warnings in selectLimit() method. Fixes #817
2022-03-29Makes affected_rows works correctly with bound variable executionMark Newnham1-4/+14
Cherry-picked from f79488b72345b53b6bb184bfc3985df7604769fe Fixes #820 # Conflicts: # drivers/adodb-mysqli.inc.php
2022-03-20Refactor ADODB_mysqli::execute()Damien Regad1-55/+47
- New private method getBindParamWithType() to remove code duplication when generating the bind param type string - Remove unnecessary variables
2022-03-20Fix PHPStorm warningsDamien Regad1-33/+34
2022-03-20Coding guidelinesDamien Regad1-52/+32
2022-03-20mysqli: restore bulkbind functionalityMark Newnham1-41/+127
Introduction of true binding in v5.22.0 broke bulk binding. This restores the bulkbind feature to the mysqli driver and adds a performance feature where the typestring can be pre-defined. Fixes #806
2022-03-18Remove commented-out codeDamien Regad1-13/+0
2022-03-18Firebird: undefined array key with uppercase columnsDamien Regad1-17/+22
Problem was caused by calling strtolower() in the $rowTransform closure. Case conversion now takes ADODB_ASSOC_CASE into account. Fixes #813
2022-03-16Fix PHP Notice in ADORecordset_firebird::_fetchField()Damien Regad1-7/+5
Fixes #808
2022-03-16Refactor ADODB_firebird::_query()Damien Regad1-22/+14
- Remove code duplication - Remove unnecessary "PHP5 compat hack" - Fix #812: PHP notice when $iarr parameter is provided but not expected by SQL statement - Coding guidelines
2022-03-16Fix PHPStorm warningsDamien Regad1-0/+6
2022-03-15Coding guidelinesDamien Regad1-18/+16
2022-03-15Firebird: fix PHP deprecation warningDamien Regad1-0/+3
Executing a SELECT statement against a table containing a null BLOB triggered deprecation warnings in PHP 8.1. _blobDecode() now returns empty string when $blob parameter is null. Fixes #811
2022-02-20Remove mysql, mysqlpo and mysqlt driversDamien Regad3-1202/+0
These legacy drivers are all based on the old mysql extension, which was deprecated in PHP 5.5 and removed in PHP 7.0. Fixes #804
2022-02-20Fix regression on mysqli::setConnectionParameter()Damien Regad1-9/+10
Restore ability to set the same parameter multiple times (see #187), that was removed in 5.21.1 [1]. Fixes #803 [1]: commits aa208834198c4cf88a5b7c2c4e71029a1f709c4d and 27ec62293ae0397c8f253795a591a6d61da88294
2022-02-19WhitespaceDamien Regad1-4/+4
2022-01-23Merge branch 'hotfix/5.21'Damien Regad1-31/+44
# Conflicts: # adodb.inc.php # docs/changelog.md
2022-01-16Fix reported errors in generated documentationDamien Regad2-10/+13
2022-01-16Remove irrelevant and incorrect @example tagDamien Regad1-1/+0
Referencing mssqlnative in the mysqli driver does not make sense. Moreover the tag is not well formed and causes phpDocumentor to throw an alert.
2022-01-16Add ADOConnection::releaseStatement() methodDamien Regad1-0/+16
This allows Oracle users to avoid reaching the maximum open cursors limit by releasing the statement resource allocated by oci_parse(), and prevent occurrence of an ORA-01000 error. The resource is cleared (set to null) after freeing statement, to avoid keeping a resource of type Unknown in the statement. Fixes #770
2022-01-16PHPDoc and coding guidelinesDamien Regad1-9/+19
Remove old, commented-out code
2022-01-16Prevent auth bypass with PostgreSQL connectionsDamien Regad1-22/+25
Thanks to Emmet Leahy of Sorcery Ltd for reporting this vulnerability (CVE-2021-3850). Refactoring ADODB_postgres64::_connect(): - Remove adodb_addslashes() function, which did not escape the connection parameters when they are wrapped in single quotes (root cause for the identified security issue). - Use addcslashes() instead of addslashes() to only escape `'` and `\`, to strictly follow pg_connect() documentation (addslashes() also escapes `"`) - Use an array and a foreach loop to build the connection string when given individual parameters for host:port, user, password and dbname Fixes #793
2022-01-09Merge branch 'master' of https://github.com/ADOdb/ADOdbMark Newnham1-1/+0
2022-01-09Remove usage of $php_errormsg from DB2 driver, see #791Mark Newnham1-14/+12
Use of $php_errormsg has been deprecated since PHP7.2 and removed in PHP 8. The driver now uses the db2_stmt_error() function to retrieve the last error instead of relying on the assigned $php_errormsg value. Warnings from ADOdb also no longer assign the value.
2022-01-08No need to define $dsnType in ADODB_pdo anymoreDamien Regad1-1/+0
It is declared in ADOConnection since e3fa991cab89ceb9724bf8c19676a450ee62a1f8. Convert ADOConnection::$dsnType comment to PHPDoc. Issue #789
2022-01-02Add missing PostgreSQL standard datatypesMike1-0/+7
Adding UUID, NUMERIC, DECIMAL, FLOAT4 and FLOAT8. Fixes #782
2021-11-08Merge _fixblobs() into _prepFields()Damien Regad2-14/+22
Following up on #767, per @Unifex's suggestion [1], removing _fixblobs() and moving its code into new _prepFields() function. Additional changes: - add PHPDoc block - protected attribute - remove return type - not really useful as in most cases success is evaluated by checking $this->fields !== false - fixed a couple remaining occurrences of is_array() checks - coding guidelines [1]: https://github.com/ADOdb/ADOdb/pull/760#issuecomment-961564909
2021-11-08Refactored ADODB_postgres7::_fixblobs() Gold2-29/+20
The call to pg_fetch_array() returns false in all cases where we would not need or want to potentially _fixblobs() and return true. A straight up boolean check is all that is needed here, no need for in_array(). Tracking through _fixblobs() is called in a number of places and how its result is checked was repeated in every case. The checks were moved into the function, which was updated to return a boolean should we want to check that. It was also noted that in every case the setting of $this->fields was identical as well so new _prepfields() method was added which sets $this->fields and calls _fixblobs(). All instances of _fixblobs() were replaced with _prepfields() and the pg_fetch_array() call deleted. Fixes #767 (replacing #760)
2021-11-07Refactor ADODB_postgres7::metaForeignKeys() case conversionDamien Regad1-3/+6
2021-11-07Uniformize metaForeignKeys() function signatureDamien Regad12-33/+31
- public visibility - camelCase - change $owner default from false to '' - add $associative param where missing - PHPDoc updates
2021-11-07WhitespaceDamien Regad6-15/+14
2021-11-07Removed ADODB_postgres7::_old_MetaForeignKeys()Damien Regad1-35/+0
Method is not used anywhere.
2021-11-07Add connection parameter to pg_lo_unlink() callDamien Regad1-1/+1
Fixes #769
2021-11-07Use pg_query() instead of pg_execute()Damien Regad1-5/+4
We are not executing prepared statements with parameters here, so using pg_execute() (which expects a 3rd parameter) is not necessary. In fact, these used to be pg_exec() calls, which were incorrectly replaced by pg_execute() instead of pg_query() in commit 2223c2a1fe8ecf5b2fc07f503a280d080596dd94. Fixes #768
2021-11-07Whitespace, coding guidelines, PHPdocDamien Regad2-7/+7
2021-10-25Merge remote-tracking branch 'origin/hotfix/5.21'Damien Regad1-0/+13
# Conflicts: # drivers/adodb-mysqli.inc.php
2021-10-25mysqli: force error reporting mode to OFFDamien Regad1-2/+15
PHP 8.1 changes the default error reporting mode from OFF to MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT [1]. We manually set it to MYSQLI_REPORT_OFF in the ADODB_mysqli class constructor to ensure compatibility. Fixes #755 [1]: https://wiki.php.net/rfc/mysqli_default_errmode