mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
* fix: resolve array modification bug in QueryRunner drop methods Fix iteration bug in QueryRunner implementations where dropping multiple database objects (columns, indices, foreign keys, unique constraints) would skip elements due to in-place array modification during iteration. The issue occurred when methods like dropColumns(), dropIndices(), dropForeignKeys(), and dropUniqueConstraints() iterated over arrays while simultaneously modifying them by removing elements. This caused a classic "off-by-one" iteration bug where alternate elements would be skipped. Changes: - Update all affected QueryRunner drop methods to iterate over a shallow copy of the input array using [...array] spread syntax - Add comprehensive regression tests in test/github-issues/11563/ - Test coverage includes all affected drivers: Postgres, MySQL, SQL Server, Oracle, CockroachDB, Spanner, SAP, and Aurora MySQL Affected drivers: - SpannerQueryRunner - PostgresQueryRunner - MysqlQueryRunner - SqlServerQueryRunner - OracleQueryRunner - CockroachQueryRunner - SapQueryRunner - AuroraMysqlQueryRunner Closes #11563 * fix: create multiple indices same column * chore: functional tests instead of github issues