summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2026-06-02pdo_firebird: override sysDate and sysTimeStamp from pdo_base defaultsHEADv5.22.11-lscLester Caine1-0/+2
ADODB_pdo_base defaults both to '?' which _UpdatePDO() copies to the parent ADODB_pdo connection. pdo_firebird must declare its own values so DEFTIMESTAMP generates LOCALTIMESTAMP rather than '?'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Fix LOCALTIMESTAMP/CURRENT_TIMESTAMP schema default handling for Firebird 4+Lester Caine1-1/+1
CURRENT_TIMESTAMP returns TIMESTAMP WITH TIME ZONE in Firebird 4+, which PHP PDO cannot handle without a valid session timezone, causing SQLSTATE 22009. - adodb-firebird.inc.php: sysTimeStamp changed to LOCALTIMESTAMP so DEFTIMESTAMP generates a timezone-naive default (propagates to pdo_firebird via adodb-pdo.inc.php) - adodb-datadict.inc.php: extend space-padding escape hatch to D/T columns so SQL keywords can be passed through verbatim as DEFAULT values Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Restore nameQuote='' for Firebird PDO — prevent quoted lowercase identifiersLester Caine1-0/+1
Without this, adodb DataDict quotes table names causing Firebird to store them as lowercase case-sensitive identifiers instead of the standard unquoted uppercase. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12Add missing functions for firebird pdo driver ?_init neededLester Caine1-2/+14
2025-11-22mysql: treat objects with __toString() as stringDamien Regad1-1/+1
Since the mysqli driver refactoring in 5.22.0 to support bound variable statements, objects passed as parameters are handled as BLOBs. This is a regression compared to earlier behavior, which allowed those having a __toString() method to be treated as strings. This restores the earlier functionality. Fixes #1075
2025-11-22WhitespaceDamien Regad1-4/+4
2025-10-25PHP 8.5: fix Non-canonical cast deprecationsDamien Regad19-39/+39
Non-canonical cast (integer) is deprecated, use the (int) cast instead Global search and replace throughout the code base. Fixes #1143
2025-09-15PDO Firebird driver extends ADODB_pdo_baseDamien Regad1-1/+1
Previously, it inherited from ADODB_pdo, which caused Fatal error: Uncaught Error: Call to undefined method ADODB_pdo_firebird::_init(). Fixes #1122
2025-08-03Refactor metaForeignKeys() methodDamien Regad1-19/+17
Use a single, more advanced regex to parse the table SQL, allowing identification of foreign key definitions with a single pass, instead of several preg_split/preg_match calls. The new regex recognizes both column and table constraints, and allows composite keys too. Case conversion (when $upper parameter is true) is performed within the foreach loop that builds the return array, instead of calling array_change_key_case() at the end. Fixes #1078, #1079, #1080
2025-08-03Ignore case when matching FOREIGN keywordDamien Regad1-1/+1
Fixes metaForeignKeys() method returning nothing when FOREIGN keyword was not given in upper case. Fixes #1078
2025-08-03Code cleanupDamien Regad1-74/+54
- Fix static analysis warnings - Remove useless code - Coding guidelines
2025-08-03Execute PRAGMA to retrieve PK after getting table infoDamien Regad1-25/+7
2025-08-03Remove unnecessary where clauseDamien Regad1-2/+1
According to SQLite schema documentation, the only valid values for *type* are 'table', 'index', 'view', or 'trigger' [1] so testing for `type != 'meta'` is useless. [1]: https://sqlite.org/schematab.html#interpretation_of_the_schema_table
2025-08-03Remove unnecessary subquery in metaForeignKeys()Damien Regad1-4/+1
2025-08-03Prevent SQL injection in sqlite3 driverDamien Regad1-22/+15
Use query parameters instead of injecting the table name in the SQL, in the following methods: - metaColumns() - metaForeignKeys() - metaIndexes() Thanks to Marco Nappi (@mrcnpp) for reporting this vulnerability. Fixes #1083, CVE-2025-54119, GHSA-vf2r-cxg9-p7rf
2025-05-01Mark pg_insert_id() as deprecatedDamien Regad1-0/+1
This function does the same thing as ADODB_postgres8::_insertID(), in a more limited way. There is no reason to keep it around. Fixes #1069
2025-05-01PHPDocDamien Regad1-2/+10
2025-05-01Fix SQL injection in pg_insert_id()Damien Regad1-1/+2
Properly escape the $tablename and $fieldname parameters used to build the sequence name.
2025-03-22Fix SQLite error reportingraspopov1-7/+13
Without debug flag, the library returns '0' instead of error messages and correct SQLite error codes. Fixes #1061, PR #1062
2025-01-25mysqli: Improve setConnectionParameterlook-was-here1-8/+60
- Simplify control statements with single if expressions. - Updated phpdoc with additional details on how to set connection property values. - Removed to-do that seemed wrong since the user should use setConnectionParameter for those or set the property directly. - Allow setting of ssl cert property values, clientFlags, port, and socket using the standard setConnectionParameter functionality. Feedback updates: - Return false for special cases with type checks on sslsert, socket, clientflags, or port fail - Added invalid connection param to output. - Simplified isset checks. - Changed sslcert to ssl and simplified subkeys to ('key', 'cert', 'ca', 'capath', 'cipher'). - Removed code duplication. - is_numeric should be checking value not parameter Fixes #1044
2025-01-25mysql: SSL not working due to wrong socket/flagslook-was-here1-2/+7
- Remove inappropriate setting of socket. - Updated to use appropriate bitwise operations to check for set SSL client flags and update the default to not overwrite set user flags. - Add friendly error to let user know they need to add a SSL client flag when using certificates. Fixes #919, #1043 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2025-01-25pgsql: fix serverInfo() version numberDamien Regad1-6/+5
In ADOdb versions < 5.21.0-beta.1, serverInfo()['version'] returned just the version number (e.g. `15.10`), which was extracted from the version string using ADOConnection::_findVers(). Commit f2b88e063d61b12a1df9090b8d0c68831ed0f447 removed the _findVers() call, so serverInfo() could potentially return additional information depending on the actual value returned by pg_version() (e.g. `15.10 (Debian 15.10-0+deb12u1)`. This could cause subsequent version comparisons to fail, e.g. in metaTables(). Fixes #1059
2024-08-28Fixing DB2 *LOCAL connectionCalvin Buckley1-9/+4
Per https://github.com/ADOdb/ADOdb/pull/1034#issuecomment-2136155259 Signed-off-by: Damien Regad <dregad@mantisbt.org> Fixed conflict resolution when applying patch.
2024-08-28move local schema outside of debug blockMark Newnham1-2/+5
2024-08-28Added SCHEMA to *LOCALMark Newnham1-8/+6
2024-08-28Added SET SCHEMA supportMark Newnham1-0/+8
2024-08-28Handle connection re-use using *LOCALMark Newnham1-13/+36
2024-05-26oci8: fix warning in qStr() with NULL on PHP 8.1Damien Regad1-5/+2
This is a follow-up commit on 1501ccd07868d626a51802d14ed41ed05a3532ad, as the original fix for #999 (see PR #1005) did not fully address the problem. Another PHP deprecated warning is thrown: strlen(): Passing null to parameter 1 ($string) of type string is deprecated. Fixes #1012 Backported from commit 8d88183538ae08b86c30af5b0f3280c2accd71c3.
2024-05-26Reset fetch mode before return from MetaColumns()Damien Regad1-5/+3
Commit 249b7fb08569ce576cd1bf26098e00701145c6ec (PR #1017) introduced a regression caused by returning from the function without resetting $ADODB_FETCH_MODE to its original value. Fixes #1016
2024-04-30MySQL: allow forcing emulated prepared statementsPaweł Kudzia1-0/+23
ADOdb 5.22.0 introduced use of bound variables and prepared statements, which broke compatibility with Manticore Search and ClickHouse. Adding $doNotUseBoundVariables property, allowing to revert to emulated prepared statements, used in ADODb until v5.21. Fixes #1028, PR #1029 Co-authored-by: Damien Regad <dregad@mantisbt.org> Reworded and formatted PHPDoc block, fixed coding guidelines.
2024-03-22ldap: PHP 8.2 error when $LDAP_CONNECT_OPTIONS not setDamien Regad1-1/+1
Calling connect() method When the $LDAP_CONNECT_OPTIONS global variable is not set results in PHP Fatal error: Uncaught TypeError: count(): Argument 1 ($value) must be of type Countable|array, null given. Replacing count()>0 by !empty() to avoid the problem. Fixes #1009
2024-01-10Catch getAssoc() execution error in metaColumns()Jessie den Ridder1-0/+4
When getAssoc() returns false, metaColumns() throws PHP Fatal error on array_change_key_case, bool given instead of array. We now check that getAssoc() completed successfully before continuing, and abort if not. Fixes #1016 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2023-11-04oci8: Fix Automatic conversion of false to arrayDamien Regad1-1/+1
On PHP 8.1, when the _query() method is called, the oci8 driver throws Automatic conversion of false to array is deprecated. Fixes #998
2023-11-01Fix mysqli bulkBind reset after one callSidney Beck Nys1-0/+2
Stored the current bulkBind value in a variable so $this->bulkBind can be reset after being set to false. Fixes #1000 (PR #1300)
2023-11-01Prevent str_replace NULL test error in PHP 8.1 (#1005)Mark Newnham1-0/+3
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-12Update ADODB_db2::_query() declaration to match parentDamien Regad1-1/+1
Regression from ae2438b731d24bf0bb159a738599b9266120e96e. Fixes #987
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-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-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-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-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-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-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