summaryrefslogtreecommitdiff
path: root/drivers/adodb-sqlite3.inc.php
AgeCommit message (Collapse)AuthorFilesLines
2025-08-18Coding guidelinesDamien Regad1-11/+9
2025-08-18sqlite: Fix SQLDate() methodDamien Regad1-14/+14
ADOdb date/time library was removed in #970. Follow-up PR #1002 replaced legacy adodb_date()/adodb_date2() calls through custom functions, by native strftime(). That introduced a regression in SQLDate() behavior, as the date formats changed from PHP-style to strftime (e.g. `Ymd` -> `%Y%m%d`). This commit partially reverts 4700171afa6c5f939e8d04b079331e207dea22ca and reintroduces the createFunction() call with a closure providing behavior compatible with the legacy adodb_date2() function. It also removes the now-useless test script that was added as part of PR #1002.
2025-08-18PSR cleanupMark Newnham1-40/+303
2025-08-18Changes the returned keys to lowercase if necessaryMark Newnham1-0/+13
Fixes #1090 Signed-off-by: Damien Regad <dregad@mantisbt.org> The original commit was modified to remove the change of indentation from tab to space.
2025-08-11Added sqlite3 specific ifnull to driverMark Newnham1-0/+12
2025-08-03Merge tag 'v5.22.10'Damien Regad1-129/+78
# Conflicts: # adodb.inc.php # docs/changelog.md
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-03-22Merge branch 'hotfix/5.22'Damien Regad1-7/+13
# Conflicts: # adodb.inc.php # docs/changelog.md
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
2023-10-18Remove remaining ADOdb date/time function callsJoe Bordes1-3/+1
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-06-10Incorrect ADORecordset::$fetchMode initializationDamien Regad1-1/+1
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-22Set $fetchMode property in ADORecordSet constructorDamien Regad1-9/+2
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-04-30Define ADOConnection::_query() methodDamien Regad1-1/+0
- Update child classes to be consistent with this declaration. - Remove unnecessary, non-PHPDoc comments - Consistent parameter names Fixes #966
2021-11-07Uniformize metaForeignKeys() function signatureDamien Regad1-1/+1
- public visibility - camelCase - change $owner default from false to '' - add $associative param where missing - PHPDoc updates
2021-11-07WhitespaceDamien Regad1-1/+1
2021-08-17Redo Merge branch 'hotfix/5.21' Standardized file headersDamien Regad1-17/+21
Try to do it right this time... # Conflicts: # adodb-memcache.lib.inc.php Fixes #751
2021-08-17Reset version to avoid merge conflictsDamien Regad1-1/+1
Fixes #751
2021-08-17Revert changes since Standardized file headers mergeDamien Regad1-45/+151
The conflicts resolution applied when merging the Standardized file headers (commit e9dcce3df24912ad869d0193f0b419f2309101fc) was seriously messed up, actually overwriting a number of changes in the master branch. Rather than trying to go and fix things one by one which has a high risk of messing things further, it's easier to redo the merge from a clean slate, so this commit reverts the following: - "Merge branch 'hotfix/5.21' Standardized file headers", e9dcce3df24912ad869d0193f0b419f2309101fc - "Merge tag 'v5.21.1'", 5f437df3104159d5d659f60e31bef8d33c34995f - "Reset version to 5.22.0-dev" af9234a525c3255af051a330164486d73be4c63a - "Fix incorrect resolution of merge conflicts" a6733f61b0165b366c8d2c70d9af82edc3881951. - "Fix syntax error in toexport.inc.php" 20b01e83cb61b6b2460f64c7d1277c5f4cc28574. Fixes #751
2021-08-14Standard file header: /driversDamien Regad1-17/+21
2021-04-11WhitespaceDamien Regad1-19/+19
2021-04-11Add stub for ADOConnection::_insertID()Damien Regad1-1/+1
Update child classes so method signature matches the parent's.
2021-03-08Bump version to 5.21.1-devDamien Regad1-1/+1
2021-02-27Bump version to 5.21.0v5.21.0Damien Regad1-1/+1
2021-02-02Bump version to 5.21.0-rc.1v5.21.0-rc.1Damien Regad1-1/+1
2021-01-24metaIndexes does not return primary key correctly, see #656 (#660)Mark Newnham1-8/+72
The primary key parameter was reversed . In addition, the method tried to obtain primary key information from the sqlite_master table, instead of the pragma (cherry picked from commit 45a1d6a567727a846fe2fa218c3f77dbc77464fc)
2020-12-20Bump version to 5.21.0-beta.1v5.21.0-beta.1Damien Regad1-1/+1
2020-12-19adodb.org is now served over SSLDamien Regad1-1/+1
Change web site references from http://adodb.org to https.
2019-12-30Provides Control of BLOB data dictionary featureMark Newnham1-0/+1
ADOdb automatically disallows setting of NOT NULL or DEFAULT values on blob type fields. This was due to historic limitations on data types that no longer exists. This commit takes the work done in PR #118 by @obmsch and adds the driver for SQLite. Fixes #292
2019-11-29Columns in SQLite metaindexes not reported correctly see #567Mark Newnham1-6/+3
The columns list in the metaindexes funtion in the SQLite driver was returned as a CSV list, not an array
2018-08-06Merge branch 'hotfix/5.20' (v5.20.13)Damien Regad1-1/+1
# Conflicts: # adodb-time.inc.php # docs/changelog.md # drivers/adodb-mssql.inc.php # drivers/adodb-mssqlnative.inc.php # drivers/adodb-oci8po.inc.php
2018-08-06Reset version to avoid merge conflictsDamien Regad1-1/+1
2018-08-06Bump version to 5.20.13v5.20.13Damien Regad1-1/+1
2018-08-06Replace adodb.sourceforge.net URLs by adodb.orgDamien Regad1-1/+1
2018-03-30Bump version to 5.20.12v5.20.12Damien Regad1-1/+1
2018-03-30Merge branch 'hotfix/5.20'Damien Regad1-0/+2
I messed up the merge at c350c007ed585a4da4dc8c62ae7954cfe13b621f. Not sure what I did or how, but the changes from the hotfix branch got lost. Redoing the merge to fix the problem.
2018-03-30Bump version to 5.20.11v5.20.11Damien Regad1-1/+1
2018-03-30Fix potential SQL injection in SelectLimit()Dave Paul1-0/+2
The `SelectLimit` function has a potential SQL injection vulnerability through the use of the `nrows` and `offset` parameters which are not forced to integers. This is a follow-up on #311, and fixes all remaining drivers that do not use ADOConnection::SelectLimit(). Fixes #401 Signed-off-by: Damien Regad <dregad@mantisbt.org> Original commits squashed, message reworded. Fixed whitespace.
2018-03-08Bump version to 5.20.10v5.20.10Damien Regad1-1/+1
2016-12-21Bump version to 5.20.9v5.20.9Damien Regad1-1/+1
2016-12-17Bump version to 5.20.8v5.20.8Damien Regad1-1/+1
2016-09-20Bump version to 5.20.7v5.20.7Damien Regad1-1/+1
2016-09-20Update changelogDamien Regad1-1/+1
2016-08-31Bump version to 5.20.6v5.20.6Damien Regad1-1/+1
2016-08-10Bump version to 5.20.5v5.20.5Damien Regad1-1/+1