Skip to content

[pull] develop from codeigniter4:develop - #73

Merged
pull[bot] merged 6 commits into
gr8man:developfrom
codeigniter4:develop
Sep 5, 2026
Merged

pull[bot] merged 6 commits into
gr8man:developfrom
codeigniter4:develop

Conversation

@pull

@pull pull Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

gr8man and others added 6 commits September 5, 2026 21:03
…10512)

* fix: MemcachedHandler::decrement() wrong sign on missing key

MemcachedHandler::decrement() passed $offset as Memcached::decrement()'s
initial_value, which is used as-is (not decremented from) when a key
doesn't exist yet. That made a fresh key end up at +$offset instead of
the -$offset every other cache handler (File, Redis, Predis) produces.

Memcached counters are unsigned, so they can't hold a negative initial
value the way the other handlers effectively can. Use 0 instead (also
Memcached::decrement()'s own default), so a fresh key at least stops
going the wrong direction.

Updates the existing MemcachedHandlerTest::testDecrement() expectation
and adds a changelog entry.

* fix: address review feedback on Memcached decrement() fix

* fix: correct expected type in MemcachedHandlerTest::testDecrement
…le move() (#10519)

* fix: correct permissions and target in File and UploadedFile move()

* docs: add changelog entry for File and UploadedFile move() permissions fix
…#10509)

SQLite cannot alter or drop a column in place, so `SQLite3\Table` rebuilds
the whole table and recreates its foreign keys from the metadata it
collected. That metadata holds prefixed table names, and `createTable()`
stripped the prefix with `trim($name, $this->db->DBPrefix)`.

`trim()`'s second argument is a set of characters, not a prefix. It removes
any of those characters from either end of the string, repeatedly, so with
the prefix `db_` it turns `db_bandit_fk` into `andit_fk` — the leading `b`
of the table's own name is eaten as well, and characters are stripped from
the end too.

The rebuilt table's foreign keys then reference tables that do not exist.
Nothing fails at that point, because foreign key enforcement is off for the
duration of the rebuild; the error surfaces at the next write to the
referenced table, naming a table that appears nowhere in the schema. Whether
a given table is affected depends on which characters its name happens to
begin and end with, so most tables come through untouched.

Strip the prefix the way `fromTable()` in the same class already does.

The existing tests could not catch this: `AlterTableTest` builds its own
connection without a `DBPrefix`, and the damage is invisible until the
constraint is used. The regression test therefore sets a prefix and names
the referenced table so that it begins with a character the prefix also
contains, which is what makes the bug reproduce.
@pull pull Bot locked and limited conversation to collaborators Sep 5, 2026
@pull pull Bot added the ⤵️ pull label Sep 5, 2026
@pull
pull Bot merged commit cc882d6 into gr8man:develop Sep 5, 2026
20 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants