feat(libSceNKWebKit): implement the WebCore SQLite wrappers #20327

Merged
Herolias merged 12 commits from upstream-pr/20327 into main 2026-11-22 05:12:32 +00:00
Herolias commented 2026-11-15 02:08:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Herolias on 2026-11-15T02:08:46Z.


What

Implements 56 libSceNKWebKit exports of the WebCore SQLite wrappers. All of them threw through NotImplemented_nid_no_patch before.

  • SQLiteDatabase, 17 exports: the constructors and destructors, open, close, executeCommand, tableExists, clearAllTables, runVacuumCommand, runIncrementalVacuumCommand, interrupt, lastError, lastErrorMsg, turnOnIncrementalAutoVacuum, setCollationFunction and the static setIsDatabaseOpeningForbidden.
  • SQLiteStatement, 27 exports:
    • the constructors and destructors;
    • prepare, step, finalize, reset and executeCommand;
    • the eight bind* exports and bindParameterCount;
    • isColumnNull and isColumnDeclaredAsBlob;
    • the getColumn* getters, including both getColumnBlobAsVector overloads.
  • SQLiteTransaction, 7 exports: the constructors and destructors, begin, commit and rollback.
  • SQLiteStatementAutoResetScope, 5 exports: the move constructors, move assignment and destructors. The two pointer constructors were already on main.

The wrappers call the sqlite3 exports of libSceNKWebKitRequirements (sqlite3_*_nid_postfix, the bundled SQLite 3.54.1). Their VFS maps guest paths, so open hands SQLite the guest path as UTF-8 and no host path is built here. libSceNKWebKit now links libSceNKWebKitRequirements privately. Requirements links only its bundled libraries, so this adds no cycle.

Which WebKit the exports follow:

  • The 3.20 module exports the pre-prepareStatement API: open(const String&, OpenMode), SQLiteStatement(SQLiteDatabase&, const String&), prepare, finalize and getColumn*.
  • The pinned 11.x tree no longer has that API. None of the 55 SQLite names that only the pin declares is in the 3.20 export inventory. Among them are its open(const String&, OpenMode, OptionSet<OpenOptions>) (NID lCTp1S9tQ5Q) and prepareStatement.
  • So the code follows WebKit 73a35b43be (August 2020). main already uses that revision for the 3.20 DiagnosticLoggingKeys and ProtectionSpaceBase exports.
  • One exception, requested in review: tableExists binds the table name, as the 11.x tableExists and tableSQL do. August 2020 tableExists concatenates the name between single quotes, so it reports an existing table named it'em as missing.

The layouts in SQLiteAbi.hpp are the release (!ASSERT_ENABLED) layouts of that revision, and each one is checked with static_assert:

  • SQLiteDatabase is 64 bytes. It has WTF::Lock bytes at 14, 24 and 40, m_openError at 44, the CString at 48 and m_lastChangesCount at 56.
  • SQLiteStatement is 24 bytes: the database reference, the query String and the sqlite3_stmt*.
  • SQLiteTransaction is 16 bytes.
  • SQLiteStatementAutoResetScope is 8 bytes.
  • SQLValue (WTF::Variant<nullptr_t, String, double>) is 16 bytes, with a signed char index at 8.
  • WTF::Function is a pointer to a CallableWrapperBase. Slot 1 of its vtable is the deleting destructor and slot 2 is call.

The code reuses the existing WtfTextAbi, WtfString and WtfVector helpers. String::utf8, StringView::utf8, String(const UChar*, unsigned) and CString(const char*) go through this library's own exports.

Inputs that throw, recorded in the debt fragment:

  • isColumnDeclaredAsBlob throws for a column without a declared type. WebKit passes the null sqlite3_column_decltype result to StringView(const char*), which calls strlen.
  • isColumnDeclaredAsBlob also throws for SQL that prepare leaves without a statement.
  • runIncrementalVacuumCommand and setCollationFunction throw on a closed database. WebKit passes the null handle to sqlite3_set_authorizer and sqlite3_create_collation_v2. Those dereference it unless SQLite was built with SQLITE_ENABLE_API_ARMOR, and the console's SQLite build is unknown.
  • bindValue throws for a valueless Variant.
  • A collation call throws through an empty WTF::Function.
  • A null object pointer throws std::invalid_argument, as the other libSceNKWebKit wrappers do.

Deviations, also in the fragment:

  • When the WTF::Lock byte is contended, the code yields until it is free. It does not park, because the WTF::ParkingLot exports still throw.
  • m_openingThread stays null because WTF::Thread::current is not implemented. Release builds read it only in assertions.
  • m_authorizer stays null because setAuthorizer is not exported.
  • Results are those of SQLite 3.54.1.

Depends on #19550, merged as 627a70cfe0:

  • open, close of a WAL database and useWALJournalMode construct SQLiteTransactionInProgressAutoCounter, so they call SQLiteDatabaseTracker::increment/decrementTransactionInProgressCount.
  • #19550 implements those exports. This change calls them through the existing declarations and does not touch them.
  • SQLiteTransaction calls the tracker only on PLATFORM(IOS_FAMILY) at this revision, so it does not.

The 7 SQLiteFileSystem exports still throw and are left for a follow-up.

Debt: docs/dev/debt/changes/feat-webcore-sqlite.md adds six Functional entries and removes the 38 inventory rows of these exports. The other 18 exports came from LegacyExports.hpp, which has no inventory rows.

Overlap:

  • tools/pr_overlap.py --names found no open pull request for these functions. The 4 tracker exports came from #19550, which is merged.
  • tools/pr_overlap.py --branch exited with status 2 against main at 851212fb98. It listed textual conflicts with 7 of the 189 pull requests that share a file or exports, and three more share exports:
    • #23083, #23475, #23753 and #24965 edit stubs, declarations or inventory rows next to the SQLite ones this change removes in Export.cpp, InventoryExports.hpp and LegacyExports.hpp.
    • #19823 and #22903 add a library to the target_link_libraries line that this change extends with libSceNKWebKitRequirements. #23752 adds its header at the same place as this change in libSceNKWebKit.hpp; it implements SQLiteFileSystem::ensureDatabaseDirectoryExists, one of the SQLiteFileSystem exports this change leaves throwing.
    • None of these 7 diffs changes a SQLiteDatabase, SQLiteStatement or SQLiteTransaction line, and in each case whoever merges second keeps both sides.
    • #24322, #24910 and #24917, three refactors by one author, copy every Export.cpp stub, the SQLite ones this change removes included, into new chunks/Export_Chunk*.cpp files and build those instead of Export.cpp. They implement none of them. Whichever merges second has to drop the copies of these stubs.
  • The tool could not compare 51 pull requests that conflict with main: #13515, #14138, #14164, #14259, #15170, #16510, #17550, #17569, #17771, #17793, #17805, #17912, #17917, #17933, #18395, #19486, #20326, #22556, #22557, #22674, #22678, #22680, #22684, #22689, #22937, #23159, #23181, #23468, #23755, #23757, #23758, #23772, #23847, #23999, #24000, #24009, #24019, #24154, #24319, #24322, #24332, #24339, #24347, #24350, #24504, #24516, #24550, #24867, #24873, #24910 and #24917.
    • For each one I applied its diff of the shared files, taken from its merge base, to copies of those files from main and from this branch in a directory outside the repository, with git apply --reject.
    • 37 of them reject the same hunks on both, so this change adds no conflict for them. None of the 51 diffs removes or edits a SQLite line.
    • #18395 (7), #20326 (4, also mine), #22556 (4), #22557 (8), #22674 (5), #23468 (5), #23757 (1), #23758 (1), #23999 (2), #24000 (1), #24009 (1), #24322 (1), #24910 (1) and #24917 (1) reject more hunks on this branch. Every extra hunk has a SQLite line this change deletes, or the target_link_libraries line it extends, in its context. They edit neighbouring stubs, declarations or inventory rows in Export.cpp, InventoryExports.hpp and LegacyExports.hpp, or the add_library line above the link line in CMakeLists.txt. Whichever merges second keeps both changes.
    • #23758, #23999, #24000 and #24009 call SQLiteDatabase's C1 constructor from their wrappers, and their tests define a mock of it, as they do for exports main already implements, such as WTF::fastMalloc.

Tested

Fedora 44 x86-64, GCC 16.2.1, GNU ld 2.46.1, CMake 4.3.0, Ninja 1.13.2, Release with -DBUILD_TESTING=ON. I ran no title, homebrew or console, because I have none.

On a535586053, the merge with main at 851212fb98:

  • The merge conflicted only in the include list of libSceNKWebKit.hpp, where #23743 added a header at the same place as this change. The resolution keeps both, and the branch's own diff against main is unchanged.
  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1390 of 6560 tests, and all 1390 passed, including nkwebkit_sqlitedatabase, nkwebkit_sqlitedatabasetracker, public_headers and patched_self_imports.
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body, and git diff --check is clean. tools/debt_fold.py --check fails here with the same two errors as on main at 851212fb98, both in libkernel_sys fragments from main (docs-libkernel-pro-measured-1360.md and fix-kernel-sys-title-workaround-bit-limit.md). On an exported copy of the branch without those two fragments, it passed.

Earlier, on 979460a282, the merge with main at c8f72e905c:

  • The merge conflicted in libSceNKWebKit/CMakeLists.txt, where #22977 added libcairo to the target_link_libraries line that this change extends with libSceNKWebKitRequirements, and in the include list of libSceNKWebKit.hpp, where #23888 and #23746 added headers at the same place as this change. Both were resolved by keeping both sides. The branch's own diff against main is unchanged, except that its target_link_libraries line now carries main's libcairo too.
  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1358 of 6396 tests, and all 1358 passed, including nkwebkit_sqlitedatabase, nkwebkit_sqlitedatabasetracker, public_headers and patched_self_imports.
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body, git diff --check is clean, and tools/debt_fold.py --check passed.

Earlier, on e467f5ccab, the merge with main at 0afe9ef689:

  • The merge conflicted in Export.cpp, where #23471 removed the FrameLoader::pageID stub right after the SQLiteStatement::prepare one this change removes, and in the include list of libSceNKWebKit.hpp, where #22561, #23723 and #23737 added headers at the same place as this change. The resolution keeps both sides of each, and the branch's own diff against main is unchanged.
  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1332 of 6320 tests, and all 1332 passed, including nkwebkit_sqlitedatabase, nkwebkit_sqlitedatabasetracker, public_headers and patched_self_imports.
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body, git diff --check is clean, and tools/debt_fold.py --check passed.

Earlier, on 31579cbef6, the merge with main at a9b7dbb49b:

  • The merge conflicted in Export.cpp and InventoryExports.hpp: #22997 removed the topPrivatelyControlledDomain stub and inventory declaration right next to the five SQLiteStatementAutoResetScope ones this change removes. The resolution keeps both removals, and the branch's own diff against main is unchanged.
  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1270 of 6173 tests, and all 1270 passed, including nkwebkit_sqlitedatabase, nkwebkit_sqlitedatabasetracker, public_headers and patched_self_imports (the libSceLibreSsl3.prx self-import is fixed on main by #22877).
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body, git diff --check is clean, and tools/debt_fold.py --check passed.

Earlier, on 8c9a194615, the merge with main at 6119c53c4b:

  • The merge conflicted in Export.cpp and LegacyExports.hpp: #22555 removed the DisplayList::DrawingItem destructor stub and declaration right next to the SQLiteStatement::getColumnBlobAsVector ones this change removes. The resolution keeps both removals, and the branch's own diff against main is unchanged.
  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1251 of 6127 tests. 1250 passed, including nkwebkit_sqlitedatabase and nkwebkit_sqlitedatabasetracker. patched_self_imports failed on libSceLibreSsl3.prx, which this change does not touch. Since #22804, its RSA_free_nid_disambig1_nid_postfix calls libSceLibreSsl's RSA_free_nid_postfix, so after NID patching the module imports 5zpup0URQoc, a name it also exports. #22877 fixes that.
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body, git diff --check is clean, and tools/debt_fold.py --check passed.

Earlier, on eef5852428, the merge with main at 852c263177, which includes #19550:

  • The merge conflicted in libSceNKWebKit/CMakeLists.txt, where main added icu_common to the target_link_libraries line that this change extends with libSceNKWebKitRequirements, and in the include list of libSceNKWebKit.hpp. Both were resolved by keeping both sides. The branch's own diff against main is unchanged.
  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1248 of 6119 tests and 291 build targets. 1247 passed, including nkwebkit_sqlitedatabase and nkwebkit_sqlitedatabasetracker on this branch alone, with no local merge.
  • patched_self_imports failed on libSceLibreSsl3.prx, which this change does not touch. Since #22804, its RSA_free_nid_disambig1_nid_postfix calls libSceLibreSsl's RSA_free_nid_postfix, so after NID patching the module imports 5zpup0URQoc, a name it also exports. #20326 on the same main fails it the same way.
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body, git diff --check is clean, and tools/debt_fold.py --check passed. With and without this change's fragment, --show differs by the six Functional entries and the 38 inventory rows.

Earlier, on 95e864a225:

  • This commit drops the four test checks that asserted NotImplemented: runIncrementalVacuumCommand and setCollationFunction on a closed database, bindValue with a valueless Variant, and isColumnDeclaredAsBlob on a column without a declared type. A maintainer said on #21981 that such checks record a gap rather than a behaviour. Those paths still throw, and the debt fragment records them.
  • cmake --build build built the whole tree. The only warnings were main's three tmpnam link warnings in libjxr and one C++23 lambda warning in libSceAgcDriver/Execution/src/VulkanDevice.cpp, none in a libSceNKWebKit file.
  • The selection was 1178 of 5855 tests. 1177 passed and none skipped. nkwebkit_sqlitedatabase aborts on this branch alone, on the #19550 dependency, as described below.
  • On a local merge with #19550 (head db0a13b034), the tree built and all 105 nkwebkit tests passed. nkwebkit_sqlitedatabase and nkwebkit_sqlitedatabasetracker passed 3 repeats each.
  • tools/check_conventions.py --base origin/main passed, and git diff --check is clean.

Earlier, on edf208d408, the merge with main at be4613dd73 (conflicts in libSceNKWebKit/CMakeLists.txt and libSceNKWebKit.hpp, each resolved by keeping both sides):

  • cmake --build build built the whole tree, with no warning in a libSceNKWebKit file.
  • The selection was 1178 of 5855 tests and 260 build targets. 1177 passed and none skipped. nkwebkit_sqlitedatabase aborts on this branch alone, as described below.
  • On a local merge with #19550 (head db0a13b034), the tree built and all 108 nkwebkit tests passed. nkwebkit_sqlitedatabase and nkwebkit_sqlitedatabasetracker passed 3 repeats each.
  • x86_64-w64-mingw32-g++ -fsyntax-only with the UCRT defines passed for SQLite.cpp, tests/SQLiteDatabase.cpp and Export.cpp.
  • main then moved to c3668a6b22, whose #17868 changes libSceNKWebKit. On a local merge with it, libSceNKWebKit and every nkwebkit test target built, and 106 of the 107 nkwebkit tests passed. nkwebkit_sqlitedatabase aborted on the #19550 dependency.
  • tools/check_conventions.py --base origin/main passed, and git diff --check is clean.

Earlier, on main at 782522d11d:

  • cmake --build build built the whole tree. The only warnings were the four already on main: three tmpnam link warnings in libjxr and one -Wc++23-extensions in libSceAgcDriver/Execution/src/VulkanDevice.cpp.
  • The selection from tools/select_tests.py (BUILD.md, "Selective test builds") was 1131 of 5508 tests and 234 build targets. 1130 passed and none skipped.
    • nkwebkit_sqlitedatabase, the new test, aborts on this branch alone at the first open. The cause is _ZN7WebCore21SQLiteDatabaseTracker35incrementTransactionInProgressCountEv not implemented, which is the dependency on #19550.
  • On a local merge of this branch (a4bf0aa1cf) with #19550 (head 1b3ce192b4):
    • the full tree built;
    • all 86 nkwebkit tests passed;
    • nkwebkit_sqlitedatabase and nkwebkit_sqlitedatabasetracker passed 3 repeats each;
    • with the August 2020 concatenated query put back in tableExists, nkwebkit_sqlitedatabase fails at the it'em check (line 185).
  • On a local merge of 43f5ca701d with main at b7aeb6f406 and #19550 (head 1b3ce192b4):
    • SQLite.cpp compiles. Before 43f5ca701d it did not: main gained an unscoped WKImeEventType enumerator named Open (a86589fc8d), which made the call to the file-local Open helper ambiguous, so the helper is now OpenDatabase;
    • all 99 nkwebkit tests passed, and nkwebkit_sqlitedatabase and nkwebkit_sqlitedatabasetracker passed 3 repeats each;
    • one target did not link, guest_icu_recovered_signatures_tests, with multiple definition of GuestPointers::Run() in libSceIcu test files that this branch does not touch.
  • nkwebkit_sqlitedatabase maps a temporary directory to the guest prefix /webcore-sqlite with AddPathAlias_nid_no_patch. It checks:
    • A closed database:
      • the constructor defaults, written over 0xA5 storage;
      • lastError and "database is not open";
      • prepare returning SQLITE_MISUSE, bindBlob returning SQLITE_ERROR and bindInt returning SQLITE_MISUSE.
    • Open failures:
      • a read-only open of a missing file gives SQLITE_CANTOPEN and "unable to open database file", and creates no file;
      • a forbidden open gives "opening database is forbidden".
    • A read-write open through the guest path:
      • the database and its -wal file appear in the mapped directory, and journal_mode is wal;
      • leading and trailing whitespace is stripped before prepare;
      • two statements in one query give SQLITE_ERROR;
      • printf is reported unauthorized;
      • an error message comes back through lastErrorMsg;
      • an empty command returns false.
    • tableExists:
      • it'em is missing before the table is created, found afterwards, and missing again after the drop; it''em is not found while it'em exists;
      • x'; DROP TABLE items; -- is missing while no such table exists, is found once a table has that name, and items is still there in both cases;
      • x' OR '1'='1, an empty name and % are missing.
    • Binding and reading:
      • every bind* export;
      • bindValue with each alternative;
      • a null String bound as text gives an empty value;
      • Latin-1 and UTF-16 text, with string reference counts unchanged afterwards;
      • every getColumn* getter, plus out-of-range columns;
      • isColumnDeclaredAsBlob on declared columns;
      • getColumnBlobAsVector: a new vector gets capacity 16, a buffer of capacity 20 is reused, and a null blob clears the vector;
      • an empty blob gives the shared empty string;
      • finalize followed by step.
    • Transactions:
      • begin then rollback, and begin then commit;
      • rollback from the destructor;
      • a read-only transaction rejecting a nested BEGIN.
    • SQLiteStatementAutoResetScope: move construction and move assignment hand the statement over, and the destructor resets it.
    • Database commands:
      • a guest WTF::Function collation (REVERSE) is moved out, called, and destroyed once through its deleting destructor at close;
      • runVacuumCommand;
      • turnOnIncrementalAutoVacuum, after which auto_vacuum reads 2;
      • runIncrementalVacuumCommand and interrupt;
      • clearAllTables keeps sqlite_sequence;
      • a read-only reopen of the database at the end.
  • tools/check_conventions.py --base origin/main passed for the branch, the title and this body.
  • tools/debt_fold.py --check fails on main at docs/dev/debt/changes/feat-icu-ulist.md line 3, which is not part of this change. On a copy of the tree with that fragment set aside, it passed both with and without this change's fragment.

Sources

All WebKit links are to commit 73a35b43be7ae44c084885bd3fa4b403e59723c8 unless noted otherwise.

Behaviour Source
SQLiteDatabase members, defaults and release layout (m_sharable only with ASSERT_ENABLED) SQLiteDatabase.h lines 159-180
SQLiteStatement layout (reference, String, sqlite3_stmt*; m_isPrepared only with ASSERT_ENABLED) SQLiteStatement.h lines 96-101
SQLiteTransaction layout SQLiteTransaction.h lines 53-55
The 11.x layout differs (a CanMakeWeakPtr base, no m_lastChangesCount) neonmodder123/PS5-WebKit-11.x 80f77e94, SQLiteDatabase.h lines 52-205
WTF::Lock is one atomic byte with bit 1 held Lock.h lines 50-131
SQLValue is Variant<nullptr_t, String, double>; the index is a signed char, and -1 is valueless SQLValue.h line 36; Variant.h lines 260-262 and 1701-1703
WTF::Function holds a unique_ptr<CallableWrapperBase>, whose virtuals are the destructor and call Function.h lines 36-41 and 122
setIsDatabaseOpeningForbidden, and open: forbidden message, open flags, sqlite3_open_v2 and its error message, unauthorized functions, extended result codes, temp_store under the tracker counter, WAL unless read-only SQLiteDatabase.cpp lines 74-161
fileSystemRepresentation is utf8() outside Cocoa FileSystemPOSIX.cpp lines 415-418
The -shm block does nothing outside iOS FileSystem.cpp lines 393-402
useWALJournalMode, close (WAL close under the tracker counter), overrideUnauthorizedFunctions and unauthorizedSQLFunction SQLiteDatabase.cpp lines 196-259 and lines 48-55
The counter calls SQLiteDatabaseTracker::increment/decrementTransactionInProgressCount SQLiteDatabaseTracker.h lines 44-55
executeCommand, clearAllTables, the vacuum commands, interrupt, lastError, lastErrorMsg SQLiteDatabase.cpp lines 374-475
tableExists binds the name and returns whether the sql column of the matching row is non-empty neonmodder123/PS5-WebKit-11.x 80f77e94, SQLiteDatabase.cpp lines 458-472
enableAuthorizer, turnOnIncrementalAutoVacuum, setCollationFunction and the collation call and destroy callbacks SQLiteDatabase.cpp lines 571-631
prepare: locks the database mutex, strips whitespace, converts to UTF-8, passes the length plus 1, and turns a non-empty tail into SQLITE_ERROR SQLiteStatement.cpp lines 56-83
stripWhiteSpace uses isSpaceOrNewline: isASCIISpace for Latin-1, otherwise u_charDirection == U_WHITE_SPACE_NEUTRAL WTFString.cpp lines 370-378; StringImpl.cpp lines 727-757; StringImpl.h lines 770-774
The rest of SQLiteStatement, from the constructor to getColumnBlobAsVector; the returnTextResults helper SQLiteStatement.cpp lines 44-55 and 85-468
A null or empty String binds a non-null pointer of length 0 StringView.h lines 387-411 and 542-554
isColumnDeclaredAsBlob passes the declared type to StringView(const char*), which calls strlen SQLiteStatement.cpp lines 278-286; StringView.h lines 351-354
Vector::resize grows to max(size, max(16, capacity + capacity / 4 + 1)), crashes above UINT_MAX / sizeof(T), and clear frees the buffer Vector.h lines 290-310, 770, 1053-1056, 1094-1108, 1184-1208 and 1223-1251
SQLiteTransaction calls the tracker only on PLATFORM(IOS_FAMILY) SQLiteTransaction.cpp lines 37-104
SQLiteStatementAutoResetScope move construction, move assignment and destructor SQLiteStatementAutoResetScope.cpp lines 34-55
A null database gives SQLITE_MISUSE from sqlite3_prepare_v2, and a null statement gives it from bind and step 3rdparty/sqlite 3.54.1 (57520227c9), src/prepare.c lines 869-875 and src/vdbeapi.c lines 54-61
Without SQLITE_ENABLE_API_ARMOR, a null handle is dereferenced by sqlite3_create_collation_v2, sqlite3_set_authorizer and sqlite3_column_decltype same, src/main.c lines 3835-3838, src/auth.c lines 70-78 and src/vdbeapi.c lines 1562-1573
The 3.20 export names, and the absence of the 55 SQLite names that only the 11.x pin declares the libSceNKWebKit declarations on main (Export.cpp, InventoryExports.hpp, LegacyExports.hpp), which come from the PS5 3.20 export inventory described in docs/dev/debt/libSceNKWebKit.md; the pin names were taken from its WEBCORE_EXPORT declarations, and tools/nid_names.py --offline --name gives lCTp1S9tQ5Q for its open

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #19550
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5318555596 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327). Originally posted by [Herolias](https://github.com/Herolias) on 2026-11-15T02:08:46Z. --- ### What Implements 56 libSceNKWebKit exports of the WebCore SQLite wrappers. All of them threw through `NotImplemented_nid_no_patch` before. - `SQLiteDatabase`, 17 exports: the constructors and destructors, `open`, `close`, `executeCommand`, `tableExists`, `clearAllTables`, `runVacuumCommand`, `runIncrementalVacuumCommand`, `interrupt`, `lastError`, `lastErrorMsg`, `turnOnIncrementalAutoVacuum`, `setCollationFunction` and the static `setIsDatabaseOpeningForbidden`. - `SQLiteStatement`, 27 exports: - the constructors and destructors; - `prepare`, `step`, `finalize`, `reset` and `executeCommand`; - the eight `bind*` exports and `bindParameterCount`; - `isColumnNull` and `isColumnDeclaredAsBlob`; - the `getColumn*` getters, including both `getColumnBlobAsVector` overloads. - `SQLiteTransaction`, 7 exports: the constructors and destructors, `begin`, `commit` and `rollback`. - `SQLiteStatementAutoResetScope`, 5 exports: the move constructors, move assignment and destructors. The two pointer constructors were already on `main`. The wrappers call the sqlite3 exports of libSceNKWebKitRequirements (`sqlite3_*_nid_postfix`, the bundled SQLite 3.54.1). Their VFS maps guest paths, so `open` hands SQLite the guest path as UTF-8 and no host path is built here. libSceNKWebKit now links libSceNKWebKitRequirements privately. Requirements links only its bundled libraries, so this adds no cycle. Which WebKit the exports follow: - The 3.20 module exports the pre-`prepareStatement` API: `open(const String&, OpenMode)`, `SQLiteStatement(SQLiteDatabase&, const String&)`, `prepare`, `finalize` and `getColumn*`. - The pinned 11.x tree no longer has that API. None of the 55 SQLite names that only the pin declares is in the 3.20 export inventory. Among them are its `open(const String&, OpenMode, OptionSet<OpenOptions>)` (NID `lCTp1S9tQ5Q`) and `prepareStatement`. - So the code follows WebKit `73a35b43be` (August 2020). `main` already uses that revision for the 3.20 `DiagnosticLoggingKeys` and `ProtectionSpaceBase` exports. - One exception, requested in review: `tableExists` binds the table name, as the 11.x [`tableExists` and `tableSQL`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L458-L472) do. August 2020 [`tableExists`](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L384-L394) concatenates the name between single quotes, so it reports an existing table named `it'em` as missing. The layouts in `SQLiteAbi.hpp` are the release (`!ASSERT_ENABLED`) layouts of that revision, and each one is checked with `static_assert`: - `SQLiteDatabase` is 64 bytes. It has `WTF::Lock` bytes at 14, 24 and 40, `m_openError` at 44, the `CString` at 48 and `m_lastChangesCount` at 56. - `SQLiteStatement` is 24 bytes: the database reference, the query `String` and the `sqlite3_stmt*`. - `SQLiteTransaction` is 16 bytes. - `SQLiteStatementAutoResetScope` is 8 bytes. - `SQLValue` (`WTF::Variant<nullptr_t, String, double>`) is 16 bytes, with a `signed char` index at 8. - `WTF::Function` is a pointer to a `CallableWrapperBase`. Slot 1 of its vtable is the deleting destructor and slot 2 is `call`. The code reuses the existing `WtfTextAbi`, `WtfString` and `WtfVector` helpers. `String::utf8`, `StringView::utf8`, `String(const UChar*, unsigned)` and `CString(const char*)` go through this library's own exports. Inputs that throw, recorded in the debt fragment: - `isColumnDeclaredAsBlob` throws for a column without a declared type. WebKit passes the null `sqlite3_column_decltype` result to `StringView(const char*)`, which calls `strlen`. - `isColumnDeclaredAsBlob` also throws for SQL that `prepare` leaves without a statement. - `runIncrementalVacuumCommand` and `setCollationFunction` throw on a closed database. WebKit passes the null handle to `sqlite3_set_authorizer` and `sqlite3_create_collation_v2`. Those dereference it unless SQLite was built with `SQLITE_ENABLE_API_ARMOR`, and the console's SQLite build is unknown. - `bindValue` throws for a valueless `Variant`. - A collation call throws through an empty `WTF::Function`. - A null object pointer throws `std::invalid_argument`, as the other libSceNKWebKit wrappers do. Deviations, also in the fragment: - When the `WTF::Lock` byte is contended, the code yields until it is free. It does not park, because the `WTF::ParkingLot` exports still throw. - `m_openingThread` stays null because `WTF::Thread::current` is not implemented. Release builds read it only in assertions. - `m_authorizer` stays null because `setAuthorizer` is not exported. - Results are those of SQLite 3.54.1. Depends on #19550, merged as `627a70cfe0`: - `open`, `close` of a WAL database and `useWALJournalMode` construct `SQLiteTransactionInProgressAutoCounter`, so they call `SQLiteDatabaseTracker::increment/decrementTransactionInProgressCount`. - #19550 implements those exports. This change calls them through the existing declarations and does not touch them. - `SQLiteTransaction` calls the tracker only on `PLATFORM(IOS_FAMILY)` at this revision, so it does not. The 7 `SQLiteFileSystem` exports still throw and are left for a follow-up. Debt: `docs/dev/debt/changes/feat-webcore-sqlite.md` adds six Functional entries and removes the 38 inventory rows of these exports. The other 18 exports came from `LegacyExports.hpp`, which has no inventory rows. Overlap: - `tools/pr_overlap.py --names` found no open pull request for these functions. The 4 tracker exports came from #19550, which is merged. - `tools/pr_overlap.py --branch` exited with status 2 against `main` at 851212fb98. It listed textual conflicts with 7 of the 189 pull requests that share a file or exports, and three more share exports: - #23083, #23475, #23753 and #24965 edit stubs, declarations or inventory rows next to the `SQLite` ones this change removes in `Export.cpp`, `InventoryExports.hpp` and `LegacyExports.hpp`. - #19823 and #22903 add a library to the `target_link_libraries` line that this change extends with `libSceNKWebKitRequirements`. #23752 adds its header at the same place as this change in `libSceNKWebKit.hpp`; it implements `SQLiteFileSystem::ensureDatabaseDirectoryExists`, one of the `SQLiteFileSystem` exports this change leaves throwing. - None of these 7 diffs changes a `SQLiteDatabase`, `SQLiteStatement` or `SQLiteTransaction` line, and in each case whoever merges second keeps both sides. - #24322, #24910 and #24917, three refactors by one author, copy every `Export.cpp` stub, the `SQLite` ones this change removes included, into new `chunks/Export_Chunk*.cpp` files and build those instead of `Export.cpp`. They implement none of them. Whichever merges second has to drop the copies of these stubs. - The tool could not compare 51 pull requests that conflict with `main`: #13515, #14138, #14164, #14259, #15170, #16510, #17550, #17569, #17771, #17793, #17805, #17912, #17917, #17933, #18395, #19486, #20326, #22556, #22557, #22674, #22678, #22680, #22684, #22689, #22937, #23159, #23181, #23468, #23755, #23757, #23758, #23772, #23847, #23999, #24000, #24009, #24019, #24154, #24319, #24322, #24332, #24339, #24347, #24350, #24504, #24516, #24550, #24867, #24873, #24910 and #24917. - For each one I applied its diff of the shared files, taken from its merge base, to copies of those files from `main` and from this branch in a directory outside the repository, with `git apply --reject`. - 37 of them reject the same hunks on both, so this change adds no conflict for them. None of the 51 diffs removes or edits a `SQLite` line. - #18395 (7), #20326 (4, also mine), #22556 (4), #22557 (8), #22674 (5), #23468 (5), #23757 (1), #23758 (1), #23999 (2), #24000 (1), #24009 (1), #24322 (1), #24910 (1) and #24917 (1) reject more hunks on this branch. Every extra hunk has a `SQLite` line this change deletes, or the `target_link_libraries` line it extends, in its context. They edit neighbouring stubs, declarations or inventory rows in `Export.cpp`, `InventoryExports.hpp` and `LegacyExports.hpp`, or the `add_library` line above the link line in `CMakeLists.txt`. Whichever merges second keeps both changes. - #23758, #23999, #24000 and #24009 call `SQLiteDatabase`'s C1 constructor from their wrappers, and their tests define a mock of it, as they do for exports `main` already implements, such as `WTF::fastMalloc`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Fedora 44 x86-64, GCC 16.2.1, GNU ld 2.46.1, CMake 4.3.0, Ninja 1.13.2, Release with `-DBUILD_TESTING=ON`. I ran no title, homebrew or console, because I have none. On `a535586053`, the merge with `main` at 851212fb98: - The merge conflicted only in the include list of `libSceNKWebKit.hpp`, where #23743 added a header at the same place as this change. The resolution keeps both, and the branch's own diff against `main` is unchanged. - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1390 of 6560 tests, and all 1390 passed, including `nkwebkit_sqlitedatabase`, `nkwebkit_sqlitedatabasetracker`, `public_headers` and `patched_self_imports`. - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body, and `git diff --check` is clean. `tools/debt_fold.py --check` fails here with the same two errors as on `main` at 851212fb98, both in `libkernel_sys` fragments from `main` (`docs-libkernel-pro-measured-1360.md` and `fix-kernel-sys-title-workaround-bit-limit.md`). On an exported copy of the branch without those two fragments, it passed. Earlier, on `979460a282`, the merge with `main` at c8f72e905c: - The merge conflicted in `libSceNKWebKit/CMakeLists.txt`, where #22977 added `libcairo` to the `target_link_libraries` line that this change extends with `libSceNKWebKitRequirements`, and in the include list of `libSceNKWebKit.hpp`, where #23888 and #23746 added headers at the same place as this change. Both were resolved by keeping both sides. The branch's own diff against `main` is unchanged, except that its `target_link_libraries` line now carries `main`'s `libcairo` too. - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1358 of 6396 tests, and all 1358 passed, including `nkwebkit_sqlitedatabase`, `nkwebkit_sqlitedatabasetracker`, `public_headers` and `patched_self_imports`. - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body, `git diff --check` is clean, and `tools/debt_fold.py --check` passed. Earlier, on `e467f5ccab`, the merge with `main` at 0afe9ef689: - The merge conflicted in `Export.cpp`, where #23471 removed the `FrameLoader::pageID` stub right after the `SQLiteStatement::prepare` one this change removes, and in the include list of `libSceNKWebKit.hpp`, where #22561, #23723 and #23737 added headers at the same place as this change. The resolution keeps both sides of each, and the branch's own diff against `main` is unchanged. - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1332 of 6320 tests, and all 1332 passed, including `nkwebkit_sqlitedatabase`, `nkwebkit_sqlitedatabasetracker`, `public_headers` and `patched_self_imports`. - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body, `git diff --check` is clean, and `tools/debt_fold.py --check` passed. Earlier, on `31579cbef6`, the merge with `main` at a9b7dbb49b: - The merge conflicted in `Export.cpp` and `InventoryExports.hpp`: #22997 removed the `topPrivatelyControlledDomain` stub and inventory declaration right next to the five `SQLiteStatementAutoResetScope` ones this change removes. The resolution keeps both removals, and the branch's own diff against `main` is unchanged. - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1270 of 6173 tests, and all 1270 passed, including `nkwebkit_sqlitedatabase`, `nkwebkit_sqlitedatabasetracker`, `public_headers` and `patched_self_imports` (the `libSceLibreSsl3.prx` self-import is fixed on `main` by #22877). - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body, `git diff --check` is clean, and `tools/debt_fold.py --check` passed. Earlier, on `8c9a194615`, the merge with `main` at 6119c53c4b: - The merge conflicted in `Export.cpp` and `LegacyExports.hpp`: #22555 removed the `DisplayList::DrawingItem` destructor stub and declaration right next to the `SQLiteStatement::getColumnBlobAsVector` ones this change removes. The resolution keeps both removals, and the branch's own diff against `main` is unchanged. - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1251 of 6127 tests. 1250 passed, including `nkwebkit_sqlitedatabase` and `nkwebkit_sqlitedatabasetracker`. `patched_self_imports` failed on `libSceLibreSsl3.prx`, which this change does not touch. Since #22804, its `RSA_free_nid_disambig1_nid_postfix` calls libSceLibreSsl's `RSA_free_nid_postfix`, so after NID patching the module imports `5zpup0URQoc`, a name it also exports. #22877 fixes that. - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body, `git diff --check` is clean, and `tools/debt_fold.py --check` passed. Earlier, on `eef5852428`, the merge with `main` at 852c263177, which includes #19550: - The merge conflicted in `libSceNKWebKit/CMakeLists.txt`, where `main` added `icu_common` to the `target_link_libraries` line that this change extends with `libSceNKWebKitRequirements`, and in the include list of `libSceNKWebKit.hpp`. Both were resolved by keeping both sides. The branch's own diff against `main` is unchanged. - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1248 of 6119 tests and 291 build targets. 1247 passed, including `nkwebkit_sqlitedatabase` and `nkwebkit_sqlitedatabasetracker` on this branch alone, with no local merge. - `patched_self_imports` failed on `libSceLibreSsl3.prx`, which this change does not touch. Since #22804, its `RSA_free_nid_disambig1_nid_postfix` calls libSceLibreSsl's `RSA_free_nid_postfix`, so after NID patching the module imports `5zpup0URQoc`, a name it also exports. #20326 on the same `main` fails it the same way. - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body, `git diff --check` is clean, and `tools/debt_fold.py --check` passed. With and without this change's fragment, `--show` differs by the six Functional entries and the 38 inventory rows. Earlier, on `95e864a225`: - This commit drops the four test checks that asserted `NotImplemented`: `runIncrementalVacuumCommand` and `setCollationFunction` on a closed database, `bindValue` with a valueless `Variant`, and `isColumnDeclaredAsBlob` on a column without a declared type. A maintainer said on #21981 that such checks record a gap rather than a behaviour. Those paths still throw, and the debt fragment records them. - `cmake --build build` built the whole tree. The only warnings were `main`'s three `tmpnam` link warnings in libjxr and one C++23 lambda warning in `libSceAgcDriver/Execution/src/VulkanDevice.cpp`, none in a libSceNKWebKit file. - The selection was 1178 of 5855 tests. 1177 passed and none skipped. `nkwebkit_sqlitedatabase` aborts on this branch alone, on the #19550 dependency, as described below. - On a local merge with #19550 (head `db0a13b034`), the tree built and all 105 `nkwebkit` tests passed. `nkwebkit_sqlitedatabase` and `nkwebkit_sqlitedatabasetracker` passed 3 repeats each. - `tools/check_conventions.py --base origin/main` passed, and `git diff --check` is clean. Earlier, on `edf208d408`, the merge with `main` at be4613dd73 (conflicts in `libSceNKWebKit/CMakeLists.txt` and `libSceNKWebKit.hpp`, each resolved by keeping both sides): - `cmake --build build` built the whole tree, with no warning in a libSceNKWebKit file. - The selection was 1178 of 5855 tests and 260 build targets. 1177 passed and none skipped. `nkwebkit_sqlitedatabase` aborts on this branch alone, as described below. - On a local merge with #19550 (head `db0a13b034`), the tree built and all 108 `nkwebkit` tests passed. `nkwebkit_sqlitedatabase` and `nkwebkit_sqlitedatabasetracker` passed 3 repeats each. - `x86_64-w64-mingw32-g++ -fsyntax-only` with the UCRT defines passed for `SQLite.cpp`, `tests/SQLiteDatabase.cpp` and `Export.cpp`. - `main` then moved to c3668a6b22, whose #17868 changes libSceNKWebKit. On a local merge with it, libSceNKWebKit and every `nkwebkit` test target built, and 106 of the 107 `nkwebkit` tests passed. `nkwebkit_sqlitedatabase` aborted on the #19550 dependency. - `tools/check_conventions.py --base origin/main` passed, and `git diff --check` is clean. Earlier, on `main` at 782522d11d: - `cmake --build build` built the whole tree. The only warnings were the four already on `main`: three `tmpnam` link warnings in libjxr and one `-Wc++23-extensions` in `libSceAgcDriver/Execution/src/VulkanDevice.cpp`. - The selection from `tools/select_tests.py` (BUILD.md, "Selective test builds") was 1131 of 5508 tests and 234 build targets. 1130 passed and none skipped. - `nkwebkit_sqlitedatabase`, the new test, aborts on this branch alone at the first `open`. The cause is `_ZN7WebCore21SQLiteDatabaseTracker35incrementTransactionInProgressCountEv not implemented`, which is the dependency on #19550. - On a local merge of this branch (`a4bf0aa1cf`) with #19550 (head `1b3ce192b4`): - the full tree built; - all 86 `nkwebkit` tests passed; - `nkwebkit_sqlitedatabase` and `nkwebkit_sqlitedatabasetracker` passed 3 repeats each; - with the August 2020 concatenated query put back in `tableExists`, `nkwebkit_sqlitedatabase` fails at the `it'em` check (line 185). - On a local merge of `43f5ca701d` with `main` at b7aeb6f406 and #19550 (head `1b3ce192b4`): - `SQLite.cpp` compiles. Before `43f5ca701d` it did not: `main` gained an unscoped `WKImeEventType` enumerator named `Open` (a86589fc8d), which made the call to the file-local `Open` helper ambiguous, so the helper is now `OpenDatabase`; - all 99 `nkwebkit` tests passed, and `nkwebkit_sqlitedatabase` and `nkwebkit_sqlitedatabasetracker` passed 3 repeats each; - one target did not link, `guest_icu_recovered_signatures_tests`, with `multiple definition of GuestPointers::Run()` in libSceIcu test files that this branch does not touch. - `nkwebkit_sqlitedatabase` maps a temporary directory to the guest prefix `/webcore-sqlite` with `AddPathAlias_nid_no_patch`. It checks: - A closed database: - the constructor defaults, written over `0xA5` storage; - `lastError` and "database is not open"; - `prepare` returning `SQLITE_MISUSE`, `bindBlob` returning `SQLITE_ERROR` and `bindInt` returning `SQLITE_MISUSE`. - Open failures: - a read-only open of a missing file gives `SQLITE_CANTOPEN` and "unable to open database file", and creates no file; - a forbidden open gives "opening database is forbidden". - A read-write open through the guest path: - the database and its `-wal` file appear in the mapped directory, and `journal_mode` is `wal`; - leading and trailing whitespace is stripped before `prepare`; - two statements in one query give `SQLITE_ERROR`; - `printf` is reported unauthorized; - an error message comes back through `lastErrorMsg`; - an empty command returns false. - `tableExists`: - `it'em` is missing before the table is created, found afterwards, and missing again after the drop; `it''em` is not found while `it'em` exists; - `x'; DROP TABLE items; --` is missing while no such table exists, is found once a table has that name, and `items` is still there in both cases; - `x' OR '1'='1`, an empty name and `%` are missing. - Binding and reading: - every `bind*` export; - `bindValue` with each alternative; - a null `String` bound as text gives an empty value; - Latin-1 and UTF-16 text, with string reference counts unchanged afterwards; - every `getColumn*` getter, plus out-of-range columns; - `isColumnDeclaredAsBlob` on declared columns; - `getColumnBlobAsVector`: a new vector gets capacity 16, a buffer of capacity 20 is reused, and a null blob clears the vector; - an empty blob gives the shared empty string; - `finalize` followed by `step`. - Transactions: - begin then rollback, and begin then commit; - rollback from the destructor; - a read-only transaction rejecting a nested `BEGIN`. - `SQLiteStatementAutoResetScope`: move construction and move assignment hand the statement over, and the destructor resets it. - Database commands: - a guest `WTF::Function` collation (`REVERSE`) is moved out, called, and destroyed once through its deleting destructor at `close`; - `runVacuumCommand`; - `turnOnIncrementalAutoVacuum`, after which `auto_vacuum` reads 2; - `runIncrementalVacuumCommand` and `interrupt`; - `clearAllTables` keeps `sqlite_sequence`; - a read-only reopen of the database at the end. - `tools/check_conventions.py --base origin/main` passed for the branch, the title and this body. - `tools/debt_fold.py --check` fails on `main` at `docs/dev/debt/changes/feat-icu-ulist.md` line 3, which is not part of this change. On a copy of the tree with that fragment set aside, it passed both with and without this change's fragment. ### Sources All WebKit links are to commit `73a35b43be7ae44c084885bd3fa4b403e59723c8` unless noted otherwise. | Behaviour | Source | | --- | --- | | `SQLiteDatabase` members, defaults and release layout (`m_sharable` only with `ASSERT_ENABLED`) | [`SQLiteDatabase.h` lines 159-180](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.h#L159-L180) | | `SQLiteStatement` layout (reference, `String`, `sqlite3_stmt*`; `m_isPrepared` only with `ASSERT_ENABLED`) | [`SQLiteStatement.h` lines 96-101](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteStatement.h#L96-L101) | | `SQLiteTransaction` layout | [`SQLiteTransaction.h` lines 53-55](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteTransaction.h#L53-L55) | | The 11.x layout differs (a `CanMakeWeakPtr` base, no `m_lastChangesCount`) | neonmodder123/PS5-WebKit-11.x `80f77e94`, [`SQLiteDatabase.h` lines 52-205](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/sql/SQLiteDatabase.h#L52-L205) | | `WTF::Lock` is one atomic byte with bit 1 held | [`Lock.h` lines 50-131](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/Lock.h#L50-L131) | | `SQLValue` is `Variant<nullptr_t, String, double>`; the index is a `signed char`, and -1 is valueless | [`SQLValue.h` line 36](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLValue.h#L36); [`Variant.h` lines 260-262 and 1701-1703](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/Variant.h#L260-L262) | | `WTF::Function` holds a `unique_ptr<CallableWrapperBase>`, whose virtuals are the destructor and `call` | [`Function.h` lines 36-41 and 122](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/Function.h#L36-L41) | | `setIsDatabaseOpeningForbidden`, and `open`: forbidden message, open flags, `sqlite3_open_v2` and its error message, unauthorized functions, extended result codes, `temp_store` under the tracker counter, WAL unless read-only | [`SQLiteDatabase.cpp` lines 74-161](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L74-L161) | | `fileSystemRepresentation` is `utf8()` outside Cocoa | [`FileSystemPOSIX.cpp` lines 415-418](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/posix/FileSystemPOSIX.cpp#L415-L418) | | The `-shm` block does nothing outside iOS | [`FileSystem.cpp` lines 393-402](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/FileSystem.cpp#L393-L402) | | `useWALJournalMode`, `close` (WAL close under the tracker counter), `overrideUnauthorizedFunctions` and `unauthorizedSQLFunction` | [`SQLiteDatabase.cpp` lines 196-259](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L196-L259) and [lines 48-55](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L48-L55) | | The counter calls `SQLiteDatabaseTracker::increment/decrementTransactionInProgressCount` | [`SQLiteDatabaseTracker.h` lines 44-55](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabaseTracker.h#L44-L55) | | `executeCommand`, `clearAllTables`, the vacuum commands, `interrupt`, `lastError`, `lastErrorMsg` | [`SQLiteDatabase.cpp` lines 374-475](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L374-L475) | | `tableExists` binds the name and returns whether the `sql` column of the matching row is non-empty | neonmodder123/PS5-WebKit-11.x `80f77e94`, [`SQLiteDatabase.cpp` lines 458-472](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L458-L472) | | `enableAuthorizer`, `turnOnIncrementalAutoVacuum`, `setCollationFunction` and the collation call and destroy callbacks | [`SQLiteDatabase.cpp` lines 571-631](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L571-L631) | | `prepare`: locks the database mutex, strips whitespace, converts to UTF-8, passes the length plus 1, and turns a non-empty tail into `SQLITE_ERROR` | [`SQLiteStatement.cpp` lines 56-83](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteStatement.cpp#L56-L83) | | `stripWhiteSpace` uses `isSpaceOrNewline`: `isASCIISpace` for Latin-1, otherwise `u_charDirection == U_WHITE_SPACE_NEUTRAL` | [`WTFString.cpp` lines 370-378](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/text/WTFString.cpp#L370-L378); [`StringImpl.cpp` lines 727-757](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/text/StringImpl.cpp#L727-L757); [`StringImpl.h` lines 770-774](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/text/StringImpl.h#L770-L774) | | The rest of `SQLiteStatement`, from the constructor to `getColumnBlobAsVector`; the `returnTextResults` helper | [`SQLiteStatement.cpp` lines 44-55 and 85-468](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteStatement.cpp#L85-L468) | | A null or empty `String` binds a non-null pointer of length 0 | [`StringView.h` lines 387-411 and 542-554](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/text/StringView.h#L387-L411) | | `isColumnDeclaredAsBlob` passes the declared type to `StringView(const char*)`, which calls `strlen` | [`SQLiteStatement.cpp` lines 278-286](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteStatement.cpp#L278-L286); [`StringView.h` lines 351-354](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/text/StringView.h#L351-L354) | | `Vector::resize` grows to `max(size, max(16, capacity + capacity / 4 + 1))`, crashes above `UINT_MAX / sizeof(T)`, and `clear` frees the buffer | [`Vector.h` lines 290-310, 770, 1053-1056, 1094-1108, 1184-1208 and 1223-1251](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WTF/wtf/Vector.h#L1053-L1056) | | `SQLiteTransaction` calls the tracker only on `PLATFORM(IOS_FAMILY)` | [`SQLiteTransaction.cpp` lines 37-104](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteTransaction.cpp#L37-L104) | | `SQLiteStatementAutoResetScope` move construction, move assignment and destructor | [`SQLiteStatementAutoResetScope.cpp` lines 34-55](https://github.com/WebKit/WebKit/blob/73a35b43be7ae44c084885bd3fa4b403e59723c8/Source/WebCore/platform/sql/SQLiteStatementAutoResetScope.cpp#L34-L55) | | A null database gives `SQLITE_MISUSE` from `sqlite3_prepare_v2`, and a null statement gives it from `bind` and `step` | `3rdparty/sqlite` 3.54.1 (`57520227c9`), `src/prepare.c` lines 869-875 and `src/vdbeapi.c` lines 54-61 | | Without `SQLITE_ENABLE_API_ARMOR`, a null handle is dereferenced by `sqlite3_create_collation_v2`, `sqlite3_set_authorizer` and `sqlite3_column_decltype` | same, `src/main.c` lines 3835-3838, `src/auth.c` lines 70-78 and `src/vdbeapi.c` lines 1562-1573 | | The 3.20 export names, and the absence of the 55 SQLite names that only the 11.x pin declares | the libSceNKWebKit declarations on `main` (`Export.cpp`, `InventoryExports.hpp`, `LegacyExports.hpp`), which come from the PS5 3.20 export inventory described in `docs/dev/debt/libSceNKWebKit.md`; the pin names were taken from its `WEBCORE_EXPORT` declarations, and `tools/nid_names.py --offline --name` gives `lCTp1S9tQ5Q` for its `open` | ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #19550 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-15 02:11:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T02:11:22Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 498b8c5e5d:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_sqlitedatabase_tests built cleanly.
  • CTest (nkwebkit_sqlitedatabase):
    1/1 Test #4087: nkwebkit_sqlitedatabase ..........Subprocess aborted***Exception:   0.18 sec
    0% tests passed, 1 tests failed out of 1
    
    [libc] unhandled exception 'St13runtime_error' thrown from 0x78f87ec8727a
    terminate called after throwing an instance of 'std::runtime_error'
      what():  _ZN7WebCore21SQLiteDatabaseTracker35incrementTransactionInProgressCountEv not implemented
    The following tests FAILED:
    
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5908554221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5908554221). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T02:11:22Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `498b8c5e5d`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_sqlitedatabase_tests` built cleanly. - **CTest** (`nkwebkit_sqlitedatabase`): ``` 1/1 Test #4087: nkwebkit_sqlitedatabase ..........Subprocess aborted***Exception: 0.18 sec 0% tests passed, 1 tests failed out of 1 ``` ``` [libc] unhandled exception 'St13runtime_error' thrown from 0x78f87ec8727a terminate called after throwing an instance of 'std::runtime_error' what(): _ZN7WebCore21SQLiteDatabaseTracker35incrementTransactionInProgressCountEv not implemented The following tests FAILED: ``` - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 03:33:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T03:33:43Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 22580af2c2:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_sqlitedatabase_tests built cleanly.
  • CTest (nkwebkit_sqlitedatabase):
    1/1 Test #4087: nkwebkit_sqlitedatabase ..........Subprocess aborted***Exception:   2.22 sec
    0% tests passed, 1 tests failed out of 1
    
    [libc] unhandled exception 'St13runtime_error' thrown from 0x711e44a8727a
    terminate called after throwing an instance of 'std::runtime_error'
      what():  _ZN7WebCore21SQLiteDatabaseTracker35incrementTransactionInProgressCountEv not implemented
    The following tests FAILED:
    
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5908857103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5908857103). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T03:33:43Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `22580af2c2`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_sqlitedatabase_tests` built cleanly. - **CTest** (`nkwebkit_sqlitedatabase`): ``` 1/1 Test #4087: nkwebkit_sqlitedatabase ..........Subprocess aborted***Exception: 2.22 sec 0% tests passed, 1 tests failed out of 1 ``` ``` [libc] unhandled exception 'St13runtime_error' thrown from 0x711e44a8727a terminate called after throwing an instance of 'std::runtime_error' what(): _ZN7WebCore21SQLiteDatabaseTracker35incrementTransactionInProgressCountEv not implemented The following tests FAILED: ``` - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
MarcZX10 commented 2026-11-15 04:50:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T04:50:45Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: safely bind the table name in tableExists so names containing quotes cannot alter the SQL query.

What I ran

Reviewed head 22580af2c2fe3563bd0c9997a4f015ff55ab4a9f and the prepared patch with repo_read.py. No commands or tests were run. Author-reported test results are not treated as runs performed for this review.

Results

Check Result Note
Patch and implementation review failed Found SQL injection in tableExists
Build and tests not run No local execution

Findings

Blocking

  • core/libs/prx/libSceNKWebKit/src/SQLite.cpp:658 — tableExists concatenates tableName directly into a quoted SQL string. A name containing an apostrophe can break out of the literal and alter the query, so the method can report misleading results and execute injected SQL during statement preparation. Use a bound parameter for the name.

Non-blocking

None.

Not verified

No build or tests were run. The full text of Export.cpp and InventoryExports.hpp was excluded from the review folder; targeted searches confirmed the old stubs are absent from Export.cpp and the SQLite tracker declarations remain in InventoryExports.hpp, but the complete files were not read. Reviewed changed files: CMakeLists.txt, LegacyExports.hpp, SQLiteExports.hpp, libSceNKWebKit.hpp, SQLite.cpp, SQLiteAbi.hpp, tests/SQLiteDatabase.cpp, and feat-webcore-sqlite.md. Excluded from the folder: Export.cpp and InventoryExports.hpp.

To get this to a good state

Bind the table name as a parameter and add coverage for names containing apostrophes and SQL syntax; then rerun the relevant SQLite test.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5909151533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5909151533). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T04:50:45Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: safely bind the table name in `tableExists` so names containing quotes cannot alter the SQL query. ## What I ran Reviewed head `22580af2c2fe3563bd0c9997a4f015ff55ab4a9f` and the prepared patch with `repo_read.py`. No commands or tests were run. Author-reported test results are not treated as runs performed for this review. ## Results | Check | Result | Note | | --- | --- | --- | | Patch and implementation review | failed | Found SQL injection in `tableExists` | | Build and tests | not run | No local execution | ## Findings ### Blocking - `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:658` — `tableExists` concatenates `tableName` directly into a quoted SQL string. A name containing an apostrophe can break out of the literal and alter the query, so the method can report misleading results and execute injected SQL during statement preparation. Use a bound parameter for the name. ### Non-blocking None. ## Not verified No build or tests were run. The full text of `Export.cpp` and `InventoryExports.hpp` was excluded from the review folder; targeted searches confirmed the old stubs are absent from `Export.cpp` and the SQLite tracker declarations remain in `InventoryExports.hpp`, but the complete files were not read. Reviewed changed files: `CMakeLists.txt`, `LegacyExports.hpp`, `SQLiteExports.hpp`, `libSceNKWebKit.hpp`, `SQLite.cpp`, `SQLiteAbi.hpp`, `tests/SQLiteDatabase.cpp`, and `feat-webcore-sqlite.md`. Excluded from the folder: `Export.cpp` and `InventoryExports.hpp`. ## To get this to a good state Bind the table name as a parameter and add coverage for names containing apostrophes and SQL syntax; then rerun the relevant SQLite test.
MarcZX10 commented 2026-11-15 16:04:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T16:04:11Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: escape or bind table names in tableExists so quoted names are matched correctly and SQL metacharacters cannot alter the query.

What I ran

  • Reviewed head 5c2adbca9c1d26d31bc9dbbe39232f53bcb9b964 using repo_read.py.
  • No commands or tests were run. The description reports author-run build and test results; these were not run by me.

Results

Check Result Note
Source review failed tableExists interpolates the table name into SQL
Build and tests not run Only author-reported results are available

Findings

Blocking

  • core/libs/prx/libSceNKWebKit/src/SQLite.cpp:658 constructs a SQL string with the caller-provided name between single quotes. A table named it'em is therefore not found, and a name containing SQL syntax can alter the query. The added test expects the quoted-name case to fail (SQLiteDatabase.cpp:185), which codifies the wrong behavior; change the implementation to bind the name as a parameter and cover quoted names and injection attempts.

Non-blocking

None.

Not verified

  • I read the prepared description, commits, diff, manifest, and full text for the included changed files: CMakeLists.txt, LegacyExports.hpp, SQLiteExports.hpp, libSceNKWebKit.hpp, SQLite.cpp, SQLiteAbi.hpp, tests/SQLiteDatabase.cpp, and docs/dev/debt/changes/feat-webcore-sqlite.md.
  • Export.cpp and include/InventoryExports.hpp were excluded from the review folder as too large; their diff hunks were available in diff.patch, but their full text was not read.
  • No build, test suite, console, or homebrew behavior was verified.

To get this to a good state

  • Bind the table name in tableExists, and update the regression test to require correct handling of quoted names while confirming injected SQL does not execute.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5911624871 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5911624871). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T16:04:11Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: escape or bind table names in `tableExists` so quoted names are matched correctly and SQL metacharacters cannot alter the query. ## What I ran - Reviewed head `5c2adbca9c1d26d31bc9dbbe39232f53bcb9b964` using `repo_read.py`. - No commands or tests were run. The description reports author-run build and test results; these were not run by me. ## Results | Check | Result | Note | | --- | --- | --- | | Source review | failed | `tableExists` interpolates the table name into SQL | | Build and tests | not run | Only author-reported results are available | ## Findings ### Blocking - `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:658` constructs a SQL string with the caller-provided name between single quotes. A table named `it'em` is therefore not found, and a name containing SQL syntax can alter the query. The added test expects the quoted-name case to fail (`SQLiteDatabase.cpp:185`), which codifies the wrong behavior; change the implementation to bind the name as a parameter and cover quoted names and injection attempts. ### Non-blocking None. ## Not verified - I read the prepared description, commits, diff, manifest, and full text for the included changed files: `CMakeLists.txt`, `LegacyExports.hpp`, `SQLiteExports.hpp`, `libSceNKWebKit.hpp`, `SQLite.cpp`, `SQLiteAbi.hpp`, `tests/SQLiteDatabase.cpp`, and `docs/dev/debt/changes/feat-webcore-sqlite.md`. - `Export.cpp` and `include/InventoryExports.hpp` were excluded from the review folder as too large; their diff hunks were available in `diff.patch`, but their full text was not read. - No build, test suite, console, or homebrew behavior was verified. ## To get this to a good state - Bind the table name in `tableExists`, and update the regression test to require correct handling of quoted names while confirming injected SQL does not execute.
MarcZX10 commented 2026-11-15 17:31:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T17:31:50Z.

Review: COMMENTED


Reviewed — comments

The implementation is extensively covered by the supplied host tests, but the declared tracker dependency is still stubbed in the target branch and no run against the merged dependency was performed by this review.

What I ran

Reviewed head 43f5ca701dfe4ae32e2acc7c70ce501db757b555. I did not run commands or tests. I read the prepared description, commits, diff, manifest, README, and the included changed-file contents; I also read the repository source for tracker stubs and SQLite requirements.

Results

Check Result Note
Diff and implementation review passed Core SQLite paths and tests inspected
Build and tests not run Author reports merged-branch checks
Console behavior not run Author reports no console run

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceNKWebKit/src/SQLite.cpp:280 calls tracker functions that remain NotImplemented_nid_no_patch in this head’s Export.cpp (lines 21646–21652). The description explicitly makes this PR depend on #19550, and reports that the SQLite test aborts without that dependency. Please ensure #19550 is merged or otherwise included before relying on this implementation; on the standalone head, database open can throw during the transaction counter.

Not verified

  • I did not run any build or tests. The successful build and merged test results are author-reported, including the local merge with #19550; they are not runs performed during this review.
  • I did not inspect every body in the 971-line implementation or all 404 lines of test code. The prepared files.json was not available as a file, so exclusions were checked from the manifest and README instead.
  • Export.cpp and InventoryExports.hpp were excluded from the prepared full-text files because they are too large, but the relevant tracker stub and declaration were read through the pinned repository reader. All other changed files were included; their full text was not all read.

To get this to a good state

Nothing is required. Optional: merge or include the stated #19550 dependency before running the SQLite database test on the combined branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5911950416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5911950416). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T17:31:50Z. **Review:** COMMENTED --- # Reviewed — comments The implementation is extensively covered by the supplied host tests, but the declared tracker dependency is still stubbed in the target branch and no run against the merged dependency was performed by this review. ## What I ran Reviewed head `43f5ca701dfe4ae32e2acc7c70ce501db757b555`. I did not run commands or tests. I read the prepared description, commits, diff, manifest, README, and the included changed-file contents; I also read the repository source for tracker stubs and SQLite requirements. ## Results | Check | Result | Note | | --- | --- | --- | | Diff and implementation review | passed | Core SQLite paths and tests inspected | | Build and tests | not run | Author reports merged-branch checks | | Console behavior | not run | Author reports no console run | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:280` calls tracker functions that remain `NotImplemented_nid_no_patch` in this head’s `Export.cpp` (lines 21646–21652). The description explicitly makes this PR depend on #19550, and reports that the SQLite test aborts without that dependency. Please ensure #19550 is merged or otherwise included before relying on this implementation; on the standalone head, database open can throw during the transaction counter. ## Not verified - I did not run any build or tests. The successful build and merged test results are author-reported, including the local merge with #19550; they are not runs performed during this review. - I did not inspect every body in the 971-line implementation or all 404 lines of test code. The prepared `files.json` was not available as a file, so exclusions were checked from the manifest and README instead. - `Export.cpp` and `InventoryExports.hpp` were excluded from the prepared full-text files because they are too large, but the relevant tracker stub and declaration were read through the pinned repository reader. All other changed files were included; their full text was not all read. ## To get this to a good state Nothing is required. Optional: merge or include the stated #19550 dependency before running the SQLite database test on the combined branch.
MarcZX10 commented 2026-11-16 17:44:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T17:44:13Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the review found one optional error-handling improvement.

What I ran

Reviewed head edf208d408f10882553a4cf34e329873ddf4a3ce using the prepared diff and the pinned repo_read.py reader. I ran no build or tests; Linux and MinGW checks below are author-reported.

Results

Check Result Note
Source review passed Core implementation and tests inspected
Build and tests not run Author reports Linux and MinGW checks
Console behavior not run No console verification confirmed

Findings

Blocking

None.

Non-blocking

  • SQLiteDatabase::open ignores failures from installing unauthorized SQL functions. If registration fails, the database still opens without the intended overrides. Consider checking each sqlite3_create_function result and handling failure consistently with the later open initialization checks. core/libs/prx/libSceNKWebKit/src/SQLite.cpp:570

Sources

Not verified

  • Did not run tests or builds, inspect a PS5 console/module, or validate the author-reported output.
  • Read CMakeLists.txt, SQLiteExports.hpp, SQLite.cpp, SQLiteAbi.hpp, and tests/SQLiteDatabase.cpp; inspected relevant portions of diff.patch, manifest.json, description.md, and commits.md.
  • Export.cpp and InventoryExports.hpp were excluded from the prepared bundle as too large; their relevant hunks were visible in diff.patch. LegacyExports.hpp and the debt fragment were listed in the manifest but not read in full.

To get this to a good state

Nothing is required. Optionally check and handle errors from the unauthorized-function registrations.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5924653885 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5924653885). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T17:44:13Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the review found one optional error-handling improvement. ## What I ran Reviewed head `edf208d408f10882553a4cf34e329873ddf4a3ce` using the prepared diff and the pinned `repo_read.py` reader. I ran no build or tests; Linux and MinGW checks below are author-reported. ## Results | Check | Result | Note | | --- | --- | --- | | Source review | passed | Core implementation and tests inspected | | Build and tests | not run | Author reports Linux and MinGW checks | | Console behavior | not run | No console verification confirmed | ## Findings ### Blocking None. ### Non-blocking - `SQLiteDatabase::open` ignores failures from installing unauthorized SQL functions. If registration fails, the database still opens without the intended overrides. Consider checking each `sqlite3_create_function` result and handling failure consistently with the later open initialization checks. `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:570` ## Sources - The checked implementation and tests are in the reviewed head: [SQLite.cpp](https://github.com/boykopovar/AnyPS5/blob/edf208d408f10882553a4cf34e329873ddf4a3ce/core/libs/prx/libSceNKWebKit/src/SQLite.cpp), [SQLiteDatabase.cpp tests](https://github.com/boykopovar/AnyPS5/blob/edf208d408f10882553a4cf34e329873ddf4a3ce/core/libs/prx/libSceNKWebKit/tests/SQLiteDatabase.cpp), and [SQLite ABI declarations](https://github.com/boykopovar/AnyPS5/blob/edf208d408f10882553a4cf34e329873ddf4a3ce/core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp). ## Not verified - Did not run tests or builds, inspect a PS5 console/module, or validate the author-reported output. - Read `CMakeLists.txt`, `SQLiteExports.hpp`, `SQLite.cpp`, `SQLiteAbi.hpp`, and `tests/SQLiteDatabase.cpp`; inspected relevant portions of `diff.patch`, `manifest.json`, `description.md`, and `commits.md`. - `Export.cpp` and `InventoryExports.hpp` were excluded from the prepared bundle as too large; their relevant hunks were visible in `diff.patch`. `LegacyExports.hpp` and the debt fragment were listed in the manifest but not read in full. ## To get this to a good state Nothing is required. Optionally check and handle errors from the unauthorized-function registrations.
MarcZX10 commented 2026-11-17 01:46:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T01:46:04Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head 95e864a225 (95e864a22516a559d0b2df1d181ad1a7b23c0047), base main. No merge preview.
  • No build and no tests in this review. The build, test and console figures in the PR body are the author's; I did not reproduce them.
  • Read the description, the commit list, the manifest and the full diff. Read the house sections "Readable reviews", "Standard PR response format" and "Accuracy and evidence".
  • Repository checks, run with repo_read.py search:
python3 repo_read.py search GuestSqliteDestructor
python3 repo_read.py search LenientConversion
python3 repo_read.py search CStringBuffer
python3 repo_read.py search StringView4utf8
python3 repo_read.py search "void NotImplemented_nid_no_patch"
python3 repo_read.py search SQLiteStatement core/libs/prx/libSceNKWebKit
python3 repo_read.py search SQLite core/libs/prx/libSceNKWebKit/Export.cpp
python3 repo_read.py search SQLite core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp
python3 repo_read.py search SQLite core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp
  • Files: the 10 changed files were read through their diff hunks. The full text of the 5 new files was read, since their diff is the whole file. Export.cpp and InventoryExports.hpp are not in files/ (too large), so they were read only as hunks. files.json was not read.

Results

Check Result Note
Build and tests not run No build in this review
Export count passed 56 definitions in SQLite.cpp match SQLiteExports.hpp
Stub removal passed No SQLite stub of these names is left in the three export files
Tracker dependency failed Counter exports still throw at head (Export.cpp:21408, :21412)
CStringBuffer layout passed Length at byte 8, data at byte 16, as Bytes() assumes
Sqlite.hpp header passed Present in the Requirements library, declares GuestSqliteDestructor
LenientConversion value not run ConversionMode is not in the repository
Null SQL path not run The StringView UTF-8 export was not found

Findings

Blocking

None in the changed hunks I read.

Non-blocking

  1. core/libs/prx/libSceNKWebKit/src/SQLite.cpp:374: Prepare calls sqlite3_prepare_v2 on statement.statement without finalizing a statement already held. Calling the exported prepare() twice on one statement leaks the first sqlite3_stmt. ReturnTextResults already finalizes first, so a small fix is if (statement.statement) Finalize(statement); before the call.
  2. core/libs/prx/libSceNKWebKit/src/SQLite.cpp:588: CallCollationFunction calls NotImplemented_nid_no_patch from a callback that SQLite invokes from C code. The debt fragment records a throw but not that the throw crosses SQLite's frames. I could not read the helper, so I cannot confirm what happens there.
  3. core/libs/prx/libSceNKWebKit/src/SQLite.cpp:701: clearAllTables builds DROP TABLE from the raw table name. A table whose name contains a space or a quote is not dropped, and the false result of ExecuteCommand is ignored. The new test covers neither case. The form appears to follow the upstream source the PR cites; I did not check that source.

Not verified

  • The build, the test counts and the console or PS5 behaviour. The PR says none of the console behaviour was measured.
  • SQLite.cpp:374 reads query.buffer->length with no null check. Whether the StringView UTF-8 export returns a null CString for a null string was not verified.
  • SQLite.cpp:248: LenientConversion = 0 depends on the ConversionMode enum, which is not in the repository.
  • NotImplemented_nid_no_patch: its definition was not found, so the behaviour in findings 2 and in the other throw paths is not confirmed.
  • SQLite.cpp:518: Close keeps useWAL and transactionInProgress. These sit in the 64-byte layout that guest code can read. Whether upstream close() resets them was not checked.
  • The SQLiteStatement search over src/ was cut at 57 of 175 lines. SQLiteDatabase and SQLiteTransaction names under src/ were not searched. The lines that were shown contained no duplicate definition.
  • Layout sizes, lock byte offsets, vtable slots and the 3.20 export signatures match the commit cited by the PR. I did not fetch that WebKit source. The static_asserts check the sizes only when the tree is built.
  • Export.cpp and InventoryExports.hpp: only their changed hunks were read. files.json was not read.

Sources

Repository paths at 95e864a22516. No external source was fetched.

To get this to a good state

Nothing is required. Merge after #19550, which this change depends on: at head the tracker counter exports still throw, so every read-write open() fails until it lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5931288654 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5931288654). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T01:46:04Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head `95e864a225` (`95e864a22516a559d0b2df1d181ad1a7b23c0047`), base `main`. No merge preview. - No build and no tests in this review. The build, test and console figures in the PR body are the author's; I did not reproduce them. - Read the description, the commit list, the manifest and the full diff. Read the house sections "Readable reviews", "Standard PR response format" and "Accuracy and evidence". - Repository checks, run with `repo_read.py search`: ``` python3 repo_read.py search GuestSqliteDestructor python3 repo_read.py search LenientConversion python3 repo_read.py search CStringBuffer python3 repo_read.py search StringView4utf8 python3 repo_read.py search "void NotImplemented_nid_no_patch" python3 repo_read.py search SQLiteStatement core/libs/prx/libSceNKWebKit python3 repo_read.py search SQLite core/libs/prx/libSceNKWebKit/Export.cpp python3 repo_read.py search SQLite core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp python3 repo_read.py search SQLite core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp ``` - Files: the 10 changed files were read through their diff hunks. The full text of the 5 new files was read, since their diff is the whole file. `Export.cpp` and `InventoryExports.hpp` are not in `files/` (too large), so they were read only as hunks. `files.json` was not read. ## Results | Check | Result | Note | | --- | --- | --- | | Build and tests | not run | No build in this review | | Export count | passed | 56 definitions in `SQLite.cpp` match `SQLiteExports.hpp` | | Stub removal | passed | No SQLite stub of these names is left in the three export files | | Tracker dependency | failed | Counter exports still throw at head (`Export.cpp:21408`, `:21412`) | | `CStringBuffer` layout | passed | Length at byte 8, data at byte 16, as `Bytes()` assumes | | `Sqlite.hpp` header | passed | Present in the Requirements library, declares `GuestSqliteDestructor` | | `LenientConversion` value | not run | `ConversionMode` is not in the repository | | Null SQL path | not run | The `StringView` UTF-8 export was not found | ## Findings ### Blocking None in the changed hunks I read. ### Non-blocking 1. `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:374`: `Prepare` calls `sqlite3_prepare_v2` on `statement.statement` without finalizing a statement already held. Calling the exported `prepare()` twice on one statement leaks the first `sqlite3_stmt`. `ReturnTextResults` already finalizes first, so a small fix is `if (statement.statement) Finalize(statement);` before the call. 2. `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:588`: `CallCollationFunction` calls `NotImplemented_nid_no_patch` from a callback that SQLite invokes from C code. The debt fragment records a throw but not that the throw crosses SQLite's frames. I could not read the helper, so I cannot confirm what happens there. 3. `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:701`: `clearAllTables` builds `DROP TABLE ` from the raw table name. A table whose name contains a space or a quote is not dropped, and the false result of `ExecuteCommand` is ignored. The new test covers neither case. The form appears to follow the upstream source the PR cites; I did not check that source. ## Not verified - The build, the test counts and the console or PS5 behaviour. The PR says none of the console behaviour was measured. - `SQLite.cpp:374` reads `query.buffer->length` with no null check. Whether the `StringView` UTF-8 export returns a null `CString` for a null string was not verified. - `SQLite.cpp:248`: `LenientConversion = 0` depends on the `ConversionMode` enum, which is not in the repository. - `NotImplemented_nid_no_patch`: its definition was not found, so the behaviour in findings 2 and in the other throw paths is not confirmed. - `SQLite.cpp:518`: `Close` keeps `useWAL` and `transactionInProgress`. These sit in the 64-byte layout that guest code can read. Whether upstream `close()` resets them was not checked. - The `SQLiteStatement` search over `src/` was cut at 57 of 175 lines. `SQLiteDatabase` and `SQLiteTransaction` names under `src/` were not searched. The lines that were shown contained no duplicate definition. - Layout sizes, lock byte offsets, vtable slots and the 3.20 export signatures match the commit cited by the PR. I did not fetch that WebKit source. The `static_assert`s check the sizes only when the tree is built. - `Export.cpp` and `InventoryExports.hpp`: only their changed hunks were read. `files.json` was not read. ## Sources Repository paths at `95e864a22516`. No external source was fetched. ## To get this to a good state Nothing is required. Merge after #19550, which this change depends on: at head the tracker counter exports still throw, so every read-write `open()` fails until it lands.
MarcZX10 commented 2026-11-18 12:15:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T12:15:37Z.

Review: COMMENTED


Reviewed — comments

The reviewed implementation adds the WebCore SQLite wrappers; one edge case in clearAllTables needs attention for unusual table names.

What I ran

Reviewed head eef58524284e205665737cfd4340962f60ad577d. I ran no commands or tests. Build and test results in the PR description are author reported.

Results

Check Result Note
Source review passed Core implementation and tests read
Build and tests not run Results were supplied by the author
Console behavior not run No console run was reported

Negative control

Not run; no test change was made during this review.

Findings

Blocking

None.

Non-blocking

  • clearAllTables inserts each table name directly into a DROP TABLE statement. Names containing spaces or SQL identifier punctuation are not quoted, so those tables may remain after the method returns. Quote identifiers or use a safe identifier-quoting helper. See core/libs/prx/libSceNKWebKit/src/SQLite.cpp:701.

Sources

Not verified

The full Export.cpp and InventoryExports.hpp texts were excluded from the review bundle; their changed hunks were visible in diff.patch. The full 2,230-line LegacyExports.hpp was not read. No tests or build were run independently.

Read: description.md, commits.md, manifest.json, diff.patch, CMakeLists.txt, LegacyExports.hpp (lines 1–30), SQLiteExports.hpp, libSceNKWebKit.hpp (changed hunk in diff), SQLite.cpp, SQLiteAbi.hpp, and tests/SQLiteDatabase.cpp. Excluded from full-text review: Export.cpp and InventoryExports.hpp.

To get this to a good state

Nothing is required. Optional: quote table identifiers in clearAllTables so names with spaces or punctuation are dropped correctly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5956358988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5956358988). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T12:15:37Z. **Review:** COMMENTED --- # Reviewed — comments The reviewed implementation adds the WebCore SQLite wrappers; one edge case in `clearAllTables` needs attention for unusual table names. ## What I ran Reviewed head `eef58524284e205665737cfd4340962f60ad577d`. I ran no commands or tests. Build and test results in the PR description are author reported. ## Results | Check | Result | Note | | --- | --- | --- | | Source review | passed | Core implementation and tests read | | Build and tests | not run | Results were supplied by the author | | Console behavior | not run | No console run was reported | ## Negative control Not run; no test change was made during this review. ## Findings ### Blocking None. ### Non-blocking - `clearAllTables` inserts each table name directly into a `DROP TABLE` statement. Names containing spaces or SQL identifier punctuation are not quoted, so those tables may remain after the method returns. Quote identifiers or use a safe identifier-quoting helper. See `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:701`. ## Sources - [SQLite wrapper implementation at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/eef58524284e205665737cfd4340962f60ad577d/core/libs/prx/libSceNKWebKit/src/SQLite.cpp#L692-L703) - [SQLite database tests at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/eef58524284e205665737cfd4340962f60ad577d/core/libs/prx/libSceNKWebKit/tests/SQLiteDatabase.cpp#L325-L358) ## Not verified The full `Export.cpp` and `InventoryExports.hpp` texts were excluded from the review bundle; their changed hunks were visible in `diff.patch`. The full 2,230-line `LegacyExports.hpp` was not read. No tests or build were run independently. Read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `CMakeLists.txt`, `LegacyExports.hpp` (lines 1–30), `SQLiteExports.hpp`, `libSceNKWebKit.hpp` (changed hunk in diff), `SQLite.cpp`, `SQLiteAbi.hpp`, and `tests/SQLiteDatabase.cpp`. Excluded from full-text review: `Export.cpp` and `InventoryExports.hpp`. ## To get this to a good state Nothing is required. Optional: quote table identifiers in `clearAllTables` so names with spaces or punctuation are dropped correctly.
PrivacyOnion commented 2026-11-18 13:48:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T13:48:16Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 8c9a194615:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_sqlitedatabase_tests built cleanly.
  • CTest (nkwebkit_sqlitedatabase):
    1/1 Test #4573: nkwebkit_sqlitedatabase ..........   Passed    0.11 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/SQLite.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified SQLiteStatement 64-bit integer binding and reading across LP64 and LLP64 platforms; std::int64_t and sqlite3_int64 align consistently with the WebCore ABI.
    • Verified error propagation and return values in SQLiteDatabase (open, close, executeCommand, tableExists, runVacuumCommand, turnOnIncrementalAutoVacuum) against upstream WebKit SQLiteDatabase semantics.
    • Audited memory management and destructor behavior across SQLiteDatabase, SQLiteStatement, SQLiteTransaction, and SQLiteStatementAutoResetScope to ensure proper finalization, reset, and no handle leaks.
    • Inspected parameter type safety, null checking (Checked helper), and string conversions (WTF String to UTF-8 via CStringBuffer/StringView4utf8).
    • Confirmed compliance with AGENTS.md rules: no prohibited comments, unimplemented exports call NotImplemented_nid_no_patch, and no title-specific workarounds.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5957903514 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5957903514). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T13:48:16Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `8c9a194615`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_sqlitedatabase_tests` built cleanly. - **CTest** (`nkwebkit_sqlitedatabase`): ``` 1/1 Test #4573: nkwebkit_sqlitedatabase .......... Passed 0.11 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/SQLite.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified SQLiteStatement 64-bit integer binding and reading across LP64 and LLP64 platforms; std::int64_t and sqlite3_int64 align consistently with the WebCore ABI. - Verified error propagation and return values in SQLiteDatabase (open, close, executeCommand, tableExists, runVacuumCommand, turnOnIncrementalAutoVacuum) against upstream WebKit SQLiteDatabase semantics. - Audited memory management and destructor behavior across SQLiteDatabase, SQLiteStatement, SQLiteTransaction, and SQLiteStatementAutoResetScope to ensure proper finalization, reset, and no handle leaks. - Inspected parameter type safety, null checking (Checked helper), and string conversions (WTF String to UTF-8 via CStringBuffer/StringView4utf8). - Confirmed compliance with AGENTS.md rules: no prohibited comments, unimplemented exports call NotImplemented_nid_no_patch, and no title-specific workarounds. Looks Good To Me
MarcZX10 commented 2026-11-18 14:34:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T14:34:06Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected implementation and quoted-name handling show no verified blocking defect, but this review is incomplete because two changed files were excluded from the review bundle and I did not run the checks.

What I ran

Reviewed head 8c9a1946153803a5d495c602f837978ea6a004a0. I did not run commands or tests; the reported Fedora build and test results are author-supplied.

Results

Check Result Note
Source review not run Partial review through the reader
Build and tests not run Only author-reported results available

Negative control

Not run; no code change or test assertion was made during this review.

Findings

Blocking

None verified in the inspected code.

Non-blocking

None.

Sources

The reviewed implementation is pinned to SQLite.cpp at this head. The tableExists implementation binds the table name as a parameter, avoiding SQL interpretation of quoted or injected names.

Not verified

I read the prepared description, commits, manifest, diff, and the included changed files core/libs/prx/libSceNKWebKit/CMakeLists.txt, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/SQLiteExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/SQLite.cpp, core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp, core/libs/prx/libSceNKWebKit/tests/SQLiteDatabase.cpp, and docs/dev/debt/changes/feat-webcore-sqlite.md. The full text of core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp was excluded as too large; I inspected their diff hunks only. I did not verify console behavior or independently reproduce the author-reported build and test results.

To get this to a good state

Nothing is required. Optional: complete review of the two excluded files and run the checks on this head before making a formal approval decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5958660069 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5958660069). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T14:34:06Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected implementation and quoted-name handling show no verified blocking defect, but this review is incomplete because two changed files were excluded from the review bundle and I did not run the checks. ## What I ran Reviewed head `8c9a1946153803a5d495c602f837978ea6a004a0`. I did not run commands or tests; the reported Fedora build and test results are author-supplied. ## Results | Check | Result | Note | |---|---|---| | Source review | not run | Partial review through the reader | | Build and tests | not run | Only author-reported results available | ## Negative control Not run; no code change or test assertion was made during this review. ## Findings ### Blocking None verified in the inspected code. ### Non-blocking None. ## Sources The reviewed implementation is pinned to [SQLite.cpp at this head](https://github.com/boykopovar/AnyPS5/blob/8c9a1946153803a5d495c602f837978ea6a004a0/core/libs/prx/libSceNKWebKit/src/SQLite.cpp). The `tableExists` implementation binds the table name as a parameter, avoiding SQL interpretation of quoted or injected names. ## Not verified I read the prepared description, commits, manifest, diff, and the included changed files `core/libs/prx/libSceNKWebKit/CMakeLists.txt`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/SQLiteExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/SQLite.cpp`, `core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp`, `core/libs/prx/libSceNKWebKit/tests/SQLiteDatabase.cpp`, and `docs/dev/debt/changes/feat-webcore-sqlite.md`. The full text of `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` was excluded as too large; I inspected their diff hunks only. I did not verify console behavior or independently reproduce the author-reported build and test results. ## To get this to a good state Nothing is required. Optional: complete review of the two excluded files and run the checks on this head before making a formal approval decision.
MarcZX10 commented 2026-11-19 00:57:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T00:57:51Z.

Review: COMMENTED


Reviewed — comments

Formal approval is not justified because two changed files were excluded from the review materials and no checks were run in this session.

What I ran

Reviewed head 31579cbef645a8ee54bcca03a55ba811aa6c344a using the prepared review materials and the pinned repository reader. No build or tests were run in this session. The description reports prior build and test results; those were not independently run here.

Results

Check Result Note
Source review not run Two changed files remain unread
Build and tests not run Prior runs are author-reported

Negative control

Not run.

Findings

Blocking

None verified.

Non-blocking

None.

Sources

Reviewed the prepared diff and source at the pinned head; no behavior claims requiring external sources are made.

Not verified

The full text of core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp was excluded by the review folder’s size rule. The manifest, diff, and prepared description were read; the complete manifest and diff were not read. The reviewed source ranges included all of src/SQLite.cpp, include/SQLiteExports.hpp, libSceNKWebKit.hpp, and the changed CMake line; selected ranges of tests/SQLiteDatabase.cpp were read. The full text of src/SQLiteAbi.hpp and the other included changed files was not verified.

To get this to a good state

Nothing is required. Optional: include the excluded files and run the relevant build and tests before requesting formal approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5967693926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5967693926). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T00:57:51Z. **Review:** COMMENTED --- # Reviewed — comments Formal approval is not justified because two changed files were excluded from the review materials and no checks were run in this session. ## What I ran Reviewed head `31579cbef645a8ee54bcca03a55ba811aa6c344a` using the prepared review materials and the pinned repository reader. No build or tests were run in this session. The description reports prior build and test results; those were not independently run here. ## Results | Check | Result | Note | | --- | --- | --- | | Source review | not run | Two changed files remain unread | | Build and tests | not run | Prior runs are author-reported | ## Negative control Not run. ## Findings ### Blocking None verified. ### Non-blocking None. ## Sources Reviewed the prepared diff and source at the pinned head; no behavior claims requiring external sources are made. ## Not verified The full text of `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` was excluded by the review folder’s size rule. The manifest, diff, and prepared description were read; the complete manifest and diff were not read. The reviewed source ranges included all of `src/SQLite.cpp`, `include/SQLiteExports.hpp`, `libSceNKWebKit.hpp`, and the changed CMake line; selected ranges of `tests/SQLiteDatabase.cpp` were read. The full text of `src/SQLiteAbi.hpp` and the other included changed files was not verified. ## To get this to a good state Nothing is required. Optional: include the excluded files and run the relevant build and tests before requesting formal approval.
MarcZX10 commented 2026-11-19 22:17:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T22:17:22Z.

Review: COMMENTED


Reviewed — comments

Changes are required before merge: resolve the non-blocking correctness and coverage points below.

What I ran

  • Reviewed head e467f5ccab9565f94a7a151ebd5ceed2e404f4f9; no commands or tests were run.
  • Read the changed ranges in CMakeLists.txt, SQLiteExports.hpp, libSceNKWebKit.hpp, SQLite.cpp, SQLiteAbi.hpp, tests/SQLiteDatabase.cpp, and feat-webcore-sqlite.md. Also inspected relevant diff hunks and the included review-folder README.

Results

Check Result Note
Source review passed Core wrapper logic inspected
Build and tests not run Author-reported results only
Full changed-file coverage not run Two large files were not read

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceNKWebKit/src/SQLite.cpp:681: tableExists treats a table as existing only when its sqlite_master.sql text is nonempty. SQLite stores NULL SQL for internal tables such as sqlite_sequence, so this reports that table as missing even while it exists. The test checks sqlite_sequence in SQLiteDatabase.cpp:350 and :353, but does not call tableExists for it. Check whether the SELECT returns a row instead of testing the SQL text.
  • core/libs/prx/libSceNKWebKit/src/SQLite.cpp:609: Rollback clears inProgress and transactionInProgress regardless of whether ROLLBACK succeeds. A failed rollback can leave the connection in a transaction while the wrapper reports it is no longer active. Consider checking the command result before updating the state, and add a test that exercises a rollback failure.

Not verified

  • Export.cpp and include/InventoryExports.hpp were excluded from the review folder and their changed ranges were not read. Therefore, I could not confirm the full export/declaration removals.
  • The report in description.md says the build and selected tests passed on Fedora 44 with GCC 16.2.1, but I did not run those checks. Console behavior was not tested.
  • No negative control was run.

To get this to a good state

Nothing is required for merge based on the inspected code. Optional: make tableExists handle SQLite entries with NULL SQL and retain transaction state when rollback fails; add focused tests for both cases.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5984298704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5984298704). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T22:17:22Z. **Review:** COMMENTED --- # Reviewed — comments Changes are required before merge: resolve the non-blocking correctness and coverage points below. ## What I ran - Reviewed head `e467f5ccab9565f94a7a151ebd5ceed2e404f4f9`; no commands or tests were run. - Read the changed ranges in `CMakeLists.txt`, `SQLiteExports.hpp`, `libSceNKWebKit.hpp`, `SQLite.cpp`, `SQLiteAbi.hpp`, `tests/SQLiteDatabase.cpp`, and `feat-webcore-sqlite.md`. Also inspected relevant diff hunks and the included review-folder README. ## Results | Check | Result | Note | | --- | --- | --- | | Source review | passed | Core wrapper logic inspected | | Build and tests | not run | Author-reported results only | | Full changed-file coverage | not run | Two large files were not read | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:681`: `tableExists` treats a table as existing only when its `sqlite_master.sql` text is nonempty. SQLite stores `NULL` SQL for internal tables such as `sqlite_sequence`, so this reports that table as missing even while it exists. The test checks `sqlite_sequence` in `SQLiteDatabase.cpp:350` and `:353`, but does not call `tableExists` for it. Check whether the `SELECT` returns a row instead of testing the SQL text. - `core/libs/prx/libSceNKWebKit/src/SQLite.cpp:609`: `Rollback` clears `inProgress` and `transactionInProgress` regardless of whether `ROLLBACK` succeeds. A failed rollback can leave the connection in a transaction while the wrapper reports it is no longer active. Consider checking the command result before updating the state, and add a test that exercises a rollback failure. ## Not verified - `Export.cpp` and `include/InventoryExports.hpp` were excluded from the review folder and their changed ranges were not read. Therefore, I could not confirm the full export/declaration removals. - The report in `description.md` says the build and selected tests passed on Fedora 44 with GCC 16.2.1, but I did not run those checks. Console behavior was not tested. - No negative control was run. ## To get this to a good state Nothing is required for merge based on the inspected code. Optional: make `tableExists` handle SQLite entries with `NULL` SQL and retain transaction state when rollback fails; add focused tests for both cases.
MarcZX10 commented 2026-11-20 17:20:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T17:20:05Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected SQLite implementation has no verified blocking defect, but this review is incomplete because several changed files were not read.

What I ran

Reviewed head 979460a282057c8152647785afd439de3913ac52 using the pinned repo_read.py reader. No build or tests were run; the checks described in the PR body are author-reported.

Results

Check Result Note
Targeted code review not run Partial review only
Build and tests not run Author reports successful runs

Findings

Blocking

None verified in the code read.

Non-blocking

None.

Not verified

Read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch (selected ranges), core/libs/prx/libSceNKWebKit/src/SQLite.cpp, and core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp.

Not read: remaining changed files in manifest.json, including Export.cpp and include/InventoryExports.hpp (excluded from the review folder as too large), as well as the complete diff and all changed tests. Build, tests, console behavior, and the author-reported checks were not independently verified.

To get this to a good state

Nothing is required. The reviewed code showed no blocking defect; this is a partial review, so a formal approval is not justified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5996661149 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-5996661149). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T17:20:05Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected SQLite implementation has no verified blocking defect, but this review is incomplete because several changed files were not read. ## What I ran Reviewed head `979460a282057c8152647785afd439de3913ac52` using the pinned `repo_read.py` reader. No build or tests were run; the checks described in the PR body are author-reported. ## Results | Check | Result | Note | |---|---|---| | Targeted code review | not run | Partial review only | | Build and tests | not run | Author reports successful runs | ## Findings ### Blocking None verified in the code read. ### Non-blocking None. ## Not verified Read: `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/diff.patch` (selected ranges), `core/libs/prx/libSceNKWebKit/src/SQLite.cpp`, and `core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp`. Not read: remaining changed files in `manifest.json`, including `Export.cpp` and `include/InventoryExports.hpp` (excluded from the review folder as too large), as well as the complete diff and all changed tests. Build, tests, console behavior, and the author-reported checks were not independently verified. ## To get this to a good state Nothing is required. The reviewed code showed no blocking defect; this is a partial review, so a formal approval is not justified.
MarcZX10 commented 2026-11-22 04:48:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:48:16Z.

Review: COMMENTED


Reviewed — comments

Changes are required before merge: review the excluded export files and address the table-name handling noted below.

What I ran

Reviewed head a5355860530e265a5de97f37e8f1f76e8e3c99c0; I ran no build or tests. The description reports Fedora build and test results, but those were not run in this review.

Results

Check Result Note
Diff and implementation review passed Core paths inspected
Build and tests not run Author-reported results only
Export inventory review not run Two files excluded

Findings

Blocking

None verified.

Non-blocking

  • clearAllTables inserts catalog table names directly into DROP TABLE SQL without quoting them. Legal identifiers containing spaces, reserved words, or quotes will fail to drop, so the method does not clear all tables for those databases. Quote and escape each identifier before executing the drop. (core/libs/prx/libSceNKWebKit/src/SQLite.cpp:701)

Not verified

core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp were excluded as too large and were not read; export registration and inventory consistency are therefore not verified. No console, title, or homebrew behavior was tested. The description’s build and test results were not independently confirmed.

Reviewed files: core/libs/prx/libSceNKWebKit/CMakeLists.txt, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/SQLiteExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/SQLite.cpp, core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp, core/libs/prx/libSceNKWebKit/tests/SQLiteDatabase.cpp, and docs/dev/debt/changes/feat-webcore-sqlite.md.

To get this to a good state

Nothing is required. Consider quoting table identifiers in clearAllTables; also review the two excluded export files before treating export registration as confirmed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6010426999 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20327#pullrequestreview-6010426999). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T04:48:16Z. **Review:** COMMENTED --- # Reviewed — comments Changes are required before merge: review the excluded export files and address the table-name handling noted below. ## What I ran Reviewed head `a5355860530e265a5de97f37e8f1f76e8e3c99c0`; I ran no build or tests. The description reports Fedora build and test results, but those were not run in this review. ## Results | Check | Result | Note | |---|---|---| | Diff and implementation review | passed | Core paths inspected | | Build and tests | not run | Author-reported results only | | Export inventory review | not run | Two files excluded | ## Findings ### Blocking None verified. ### Non-blocking - `clearAllTables` inserts catalog table names directly into `DROP TABLE` SQL without quoting them. Legal identifiers containing spaces, reserved words, or quotes will fail to drop, so the method does not clear all tables for those databases. Quote and escape each identifier before executing the drop. (`core/libs/prx/libSceNKWebKit/src/SQLite.cpp:701`) ## Not verified `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` were excluded as too large and were not read; export registration and inventory consistency are therefore not verified. No console, title, or homebrew behavior was tested. The description’s build and test results were not independently confirmed. Reviewed files: `core/libs/prx/libSceNKWebKit/CMakeLists.txt`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/SQLiteExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/SQLite.cpp`, `core/libs/prx/libSceNKWebKit/src/SQLiteAbi.hpp`, `core/libs/prx/libSceNKWebKit/tests/SQLiteDatabase.cpp`, and `docs/dev/debt/changes/feat-webcore-sqlite.md`. ## To get this to a good state Nothing is required. Consider quoting table identifiers in `clearAllTables`; also review the two excluded export files before treating export registration as confirmed.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!20327
No description provided.