Skip to content

TDbCache quotes its VALUE column on Firebird (#1497) - #1610

Open
belisoful wants to merge 1 commit into
pradosoft:masterfrom
belisoful:tdbcache-firebird
Open

belisoful wants to merge 1 commit into
pradosoft:masterfrom
belisoful:tdbcache-firebird

Conversation

@belisoful

@belisoful belisoful commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Part of #1497. TDbCache on Firebird, the open finding from #1589.

VALUE is a reserved word in Firebird, so TDbCache could not create its table there: CREATE TABLE ... (itemkey CHAR(128) NOT NULL PRIMARY KEY, value BLOB, expire INTEGER) failed with SQL error -104, "Token unknown".

Fix:

  • getValueColumn() returns the value column as SQL: "VALUE" on Firebird, the name Firebird gives an unquoted value, and value elsewhere. The table creation, the read, the insert, and the upsert use it, so other drivers' SQL is unchanged.
  • set() on Firebird upserts with UPDATE OR INSERT ... MATCHING (itemkey) (getUpsertSql()); it deleted and inserted in a transaction.

Tests:

  • TDbCacheFirebirdTest runs TDbCacheDriverTestTrait on the Firebird server of the Prado Data (Firebird) job.
  • TDbCacheTest::testFirebirdQuotesTheValueColumn checks the Firebird SQL in the unit suite.

The full unit suite passes with XDEBUG_MODE=off, the new unit test passes on PHP 8.2 to 8.5, and the TDbCache driver tests pass locally on SQLite, MySQL, and PostgreSQL. pdo_firebird is not installed locally, so Firebird is verified in CI.

testSetJoinsTheCurrentTransaction runs on Firebird with no skip: #1611 makes a TDbConnection rollback take effect there before PHP 8.4.

@belisoful
belisoful marked this pull request as ready for review November 21, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant