You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: listTables() lists MariaDB sequences and PostgreSQL partitions #17769
Describe the bug listTables() gives objects that are not tables:
MariaDB: the MySQL dialect runs SHOW TABLES, which also lists the sequences.
PostgreSQL: the dialect reads information_schema.tables with no filter on the type. It lists each partition of a partitioned table as a BASE TABLE, next to the parent table.
To Reproduce
MariaDB 10.6.28:
CREATESEQUENCEs1;
CREATETABLEt1 (id INTPRIMARY KEY);
The query of the MySQL dialect (SHOW TABLES) gives s1 and t1. SHOW FULL TABLES gives s1 as a SEQUENCE.
PostgreSQL 18.7:
CREATETABLEm (id int, d date) PARTITION BY RANGE (d);
CREATETABLEm_2026_01 PARTITION OF m FOR VALUESFROM ('2026-01-01') TO ('2026-02-01');
CREATETABLEm_2026_02 PARTITION OF m FOR VALUESFROM ('2026-02-01') TO ('2026-03-01');
The query of the PostgreSQL dialect gives m, m_2026_01 and m_2026_02, each a BASE TABLE. A sequence is not listed.
Expected behavior listTables() gives no sequences and no partitions. The views stay as they are today (MySQL and PostgreSQL list them), so this is no change for the views.
A possible fix:
MySQL dialect: SHOW FULL TABLES ... WHERE Table_type <> 'SEQUENCE', and only the first column is read.
PostgreSQL dialect: leave out the partitions (pg_class.relispartition).
Details
Phalcon version: 5.0.x (cfcf481836): phalcon/Db/Dialect/Mysql.zep and phalcon/Db/Dialect/Postgresql.zep, listTables(). phalcon/phalcon v6.0.x has the same queries (src/Db/Dialect/Mysql.php, src/Db/Dialect/Postgresql.php).
Additional context
Found in phalcon/crest#88: crest make:model --all writes a model for each MariaDB sequence and for each PostgreSQL partition. A table with 24 monthly partitions gives 25 models.
Activity
niden commentedon Nov 25, 2026
Resolved in #17792
[phalcon#17769] - fixing list tables for sequences
[phalcon#17769] - updating ext and changelog