Use psql's unaligned format in EXPLAIN tests, to make it less brittle.
In aligned format, there is an end-of-line marker at the end of each line, and its position depends on the longest line. If the width changes, all lines need to be adjusted for the moved end-of-line-marker. While testing this, we found out that 'atmsort' had been doing bad things to the YAML output before: -- Check Explain YAML output EXPLAIN (FORMAT YAML) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT JOIN box_locations ON box_locations.id = boxes.location_id; QUERY PLAN ___________ { 'id' => 1, 'short' => '- Plan: +' } GP_IGNORE:(1 row) In other worse, we were not comparing the output at all, except for that one line that says "Plan:". The access plan for one of the queries had changed, from a Left Join to a Right Join, and we still had the old plan memorized in expected output, but the test was passing because atmsort hid the issue. This commit fixes the expected output for the new plan.
Showing
想要评论请 注册 或 登录