Hi Henson, >> With v55 I don't see the error? > > Right, v55 returns 0. As section 1 says under "How it has been > handled so far", v54 and v55 wrap what pull-up, join alias expansion > and virtual generated column expansion put in, in a PlaceHolderVar, > so this example and a, b and c return 0. The example shows the > problem without that wrapping. > > But the wrapping fixes it the wrong way. When a join alias is > expanded below its join level, as in the JOIN USING example in the > same section, the backend crashes, and other shapes fail with > internal errors. So the wrapping has to go either way, and that > leaves two ways: > > 1. Remove the wrapping and accept the division by zero at plan > time. > 2. Remove the wrapping and go with the other fix in section 3, > folding in two passes. > > Section 2 of my last mail asked you to choose between these two. > Which would you prefer, or do you see a better way?
Ok, so the case is the division by zero in the constant folding at the planning time. If that is the only case, I would consider working hard for #2 not worth the trouble. I prefer #1 and we should write it as a limitation of the patch so that we don't forget about it. Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp
