Skip to content

sql: avoid using Tuple in ValuesClause#28191

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20180802-valuesclause-notuple
Aug 2, 2018
Merged

sql: avoid using Tuple in ValuesClause#28191
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20180802-valuesclause-notuple

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Aug 2, 2018

Forked off from #28143.
Needed for #26624.

The Tuple AST node is really about scalar tuples. The VALUES
clause operands are not really scalar tuples. So instead use
Exprs for ValuesClause.

This will simplify later patch to fix the handling of scalar tuples.

Release note: None

@knz knz requested review from a team, BramGruneir, jordanlewis and rjnn August 2, 2018 08:32
@knz knz requested a review from a team as a code owner August 2, 2018 08:32
@knz knz requested review from a team August 2, 2018 08:32
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz knz force-pushed the 20180802-valuesclause-notuple branch 2 times, most recently from f1f4b2d to b4dd1d1 Compare August 2, 2018 09:11
Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)


pkg/sql/sem/tree/values.go, line 28 at r1 (raw file):

// ValuesClause represents a VALUES clause.
type ValuesClause struct {
	Tuples []Exprs

[nit] should we update the member name? Maybe Rows?


pkg/sql/sem/tree/values.go, line 38 at r1 (raw file):

		ctx.WriteString(comma)
		ctx.WriteByte('(')
		ctx.FormatNode(&node.Tuples[i])

Is & needed here? node.Tuples[i] is an Expr..

Copy link
Copy Markdown
Contributor

@rjnn rjnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 15 of 15 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)

@knz knz force-pushed the 20180802-valuesclause-notuple branch from b4dd1d1 to ac0528f Compare August 2, 2018 11:59
Copy link
Copy Markdown
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale)


pkg/sql/sem/tree/values.go, line 28 at r1 (raw file):

Previously, RaduBerinde wrote…

[nit] should we update the member name? Maybe Rows?

Done.


pkg/sql/sem/tree/values.go, line 38 at r1 (raw file):

Previously, RaduBerinde wrote…

Is & needed here? node.Tuples[i] is an Expr..

no, node.Tuples[i] is an Exprs. This implements NodeFormatter by pointer, not by value.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Aug 2, 2018

TFYRs!

bors r+

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale)


pkg/testutils/lint/lint_test.go, line 108 at r2 (raw file):

	t.Run("TestLowercaseFunctionNames", func(t *testing.T) {
		t.Skip("woo")

Leftover?

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Aug 2, 2018

bors r-

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 2, 2018

Canceled

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Aug 2, 2018

yeah good catch

The `Tuple` AST node is really about scalar tuples. The `VALUES`
clause operands are not really scalar tuples. So instead use
`Exprs` for `ValuesClause`.

This will simplify later patch to fix the handling of scalar tuples.

Release note: None
@knz knz force-pushed the 20180802-valuesclause-notuple branch from ac0528f to 246afb6 Compare August 2, 2018 12:21
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Aug 2, 2018

bors r+

craig bot pushed a commit that referenced this pull request Aug 2, 2018
28191:  sql: avoid using Tuple in ValuesClause r=knz a=knz

Forked off from #28143.
Needed for #26624.

The `Tuple` AST node is really about scalar tuples. The `VALUES`
clause operands are not really scalar tuples. So instead use
`Exprs` for `ValuesClause`.

This will simplify later patch to fix the handling of scalar tuples.

Release note: None



Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 2, 2018

Build succeeded

@craig craig bot merged commit 246afb6 into cockroachdb:master Aug 2, 2018
@knz knz deleted the 20180802-valuesclause-notuple branch February 14, 2019 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants