mirror of
https://github.com/discourse/discourse.git
synced 2025-06-11 05:03:42 +08:00

Currently, the first two rows returned by `DiscourseDB#query_array` are silently dropped during the column size check in `DiscourseDB#load_mapping`. This happens because the rows object, while an enumerator, isn't fully compliant, it doesn't rewind during introspection. As a result, calls like `#first`, `#peek`, or `#any?` advance the iterator. Ideally, we’d fix this by updating the `query_array` enumeration implementation. However, customizing the enumerator to be fully compliant would likely introduce unnecessary perf overhead for all use cases. So, this fix works around that limitation by building the map a little differently.