cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql:Hoist project session flag and support session settings in opt tests

Open msirek opened this issue 3 years ago • 1 comments

This commit adds the disable_hoist_projection_in_join_limitation session flag.

Release note: none

opttester: support session settings in opt tests

This commit adds the set opttest flag which can be used to set session flags via "set=flagname=value".

Release note: none

msirek avatar Aug 10 '22 23:08 msirek

This change is Reviewable

cockroach-teamcity avatar Aug 10 '22 23:08 cockroach-teamcity

@msirek it'd be ideal to get this PR and backports merged today so that the fixes can make it into the next 22.1 and 21.2 releases. The most pressing is the 21.2 backport.

mgartner avatar Aug 22 '22 15:08 mgartner

Can the set flag set multiple session settings for the same test? Might be good to document how to do that if the syntax is not obvious.

Yes. The syntax is the same as for other flags. These are space-separated flags, e.g.

opt expect=HoistProjectFromInnerJoin set=disable_hoist_projection_in_join_limitation=true set=prefer_lookup_joins_for_fks=true

msirek avatar Aug 23 '22 20:08 msirek

Canceled.

craig[bot] avatar Aug 23 '22 21:08 craig[bot]

pkg/sql/opt/testutils/opttester/opt_tester.go line 286 at r10 (raw file):

Previously, msirek (Mark Sirek) wrote…

OK, I picked the first option. I have seen reference cycles elsewhere. For example, norm.Factory -> funcs (norm.CustomFuncs) -> f(norm.Factory). Do you think we should open an issue to remove this and other reference cycles?

It's probably not necessary, just something to avoid to prevent if possible to avoid confusion. I don't feel to strongly about it. The norm.Factory norm.CustomFuncs case it required because they depend on each other - this case was different because Flags didn't depend on ot, only two fields within ot.

mgartner avatar Aug 23 '22 21:08 mgartner

Build failed (retrying...):

craig[bot] avatar Aug 23 '22 23:08 craig[bot]

Build failed (retrying...):

craig[bot] avatar Aug 23 '22 23:08 craig[bot]

Build failed (retrying...):

craig[bot] avatar Aug 24 '22 00:08 craig[bot]

Canceled.

craig[bot] avatar Aug 24 '22 04:08 craig[bot]

bors r+

msirek avatar Aug 24 '22 06:08 msirek

Build failed (retrying...):

craig[bot] avatar Aug 24 '22 12:08 craig[bot]

bors r+

msirek avatar Aug 24 '22 14:08 msirek

Already running a review

craig[bot] avatar Aug 24 '22 14:08 craig[bot]

bors r+

msirek avatar Aug 24 '22 14:08 msirek

Already running a review

craig[bot] avatar Aug 24 '22 14:08 craig[bot]

Build failed:

craig[bot] avatar Aug 24 '22 18:08 craig[bot]

bors r+

msirek avatar Aug 24 '22 21:08 msirek

Build failed:

craig[bot] avatar Aug 24 '22 22:08 craig[bot]

bors r+

msirek avatar Aug 24 '22 22:08 msirek

Build failed (retrying...):

craig[bot] avatar Aug 25 '22 03:08 craig[bot]

Build failed (retrying...):

craig[bot] avatar Aug 25 '22 08:08 craig[bot]

Build succeeded:

craig[bot] avatar Aug 25 '22 11:08 craig[bot]