Fix schema reconstruction with native numeric results - #506
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe information schema reconstructor now casts SQLite metadata flags to integers before comparison. Parameterized tests verify reconstruction with native and stringified PDO fetch values. ChangesSQLite metadata normalization
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Schema reconstruction now preserves SQLite column and index metadata regardless of PDO numeric fetch representation. The change includes coverage for both stringified and native numeric results, with no remaining merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6068950 to
743439f
Compare
Normalize SQLite’s numeric schema flags before strict comparisons. Cover reconstruction with string fetching enabled and disabled, including column defaults, nullability, and indexes. #422
743439f to
71c946c
Compare
Summary
Make schema reconstruction independent of
PDO::ATTR_STRINGIFY_FETCHES. Interpret SQLite's primary-key, nullability, and uniqueness flags as integers so reconstruction preserves auto-increment columns,NOT NULL, defaults, and unique indexes in either fetch mode.Add a regression test that creates an existing SQLite table before driver initialization and verifies its reconstructed column and index metadata with string fetching enabled and disabled.
Why
Reconstruction compared SQLite's numeric flags strictly against strings. Since connection initialization stopped forcing string results in #291, reconstruction can receive integers before WordPress enables string fetching. This could mark every column in an auto-increment table as auto-incrementing, causing a later
ALTER TABLEto fail with "has more than one primary key."Related to #422.
Summary by CodeRabbit
Bug Fixes
Tests