Skip to content

sql: Log event for TRUNCATE TABLE#25868

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
a-robinson:truncate-event
May 23, 2018
Merged

sql: Log event for TRUNCATE TABLE#25868
craig[bot] merged 1 commit intocockroachdb:masterfrom
a-robinson:truncate-event

Conversation

@a-robinson
Copy link
Copy Markdown
Contributor

Fixes #25867

Release note (sql change): TRUNCATE TABLE commands are now logged in the
event log.

@a-robinson a-robinson requested review from a team and jordanlewis May 23, 2018 19:05
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@a-robinson
Copy link
Copy Markdown
Contributor Author

screen shot 2018-05-23 at 1 57 15 pm

Copy link
Copy Markdown
Contributor

@vilterp vilterp left a comment

Choose a reason for hiding this comment

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

Thanks!

@BramGruneir
Copy link
Copy Markdown
Member

:lgtm:


Reviewed 5 of 5 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


pkg/sql/event_log.go, line 43 at r1 (raw file):

	// EventLogDropTable is recorded when a table is dropped.
	EventLogDropTable EventLogType = "drop_table"
	// EventLogTruncateTable is recorded when a table is dropped.

truncated not dropped


pkg/ui/src/util/eventTypes.ts, line 9 at r1 (raw file):

type Event = protos.cockroach.server.serverpb.EventsResponse.Event;

// Recorded when a database is created.

might be nice to alphabetize this


pkg/ui/src/util/eventTypes.ts, line 63 at r1 (raw file):

export const databaseEvents = [CREATE_DATABASE, DROP_DATABASE];
export const tableEvents = [
  CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, ALTER_TABLE, CREATE_INDEX,

And to alphabetize this as well


Comments from Reviewable

Fixes cockroachdb#25867

Release note (sql change): TRUNCATE TABLE commands are now logged in the
event log.
@a-robinson
Copy link
Copy Markdown
Contributor Author

TFTRs!


Review status: all files reviewed at latest revision, 3 unresolved discussions.


pkg/sql/event_log.go, line 43 at r1 (raw file):

Previously, BramGruneir (Bram Gruneir) wrote…

truncated not dropped

Done.


pkg/ui/src/util/eventTypes.ts, line 9 at r1 (raw file):

Previously, BramGruneir (Bram Gruneir) wrote…

might be nice to alphabetize this

Right now it's grouped logically by the object being acted on, which seems kind of nice to me. Mind if I leave it as is?


pkg/ui/src/util/eventTypes.ts, line 63 at r1 (raw file):

Previously, BramGruneir (Bram Gruneir) wrote…

And to alphabetize this as well

Same as above.


Comments from Reviewable

@vilterp
Copy link
Copy Markdown
Contributor

vilterp commented May 23, 2018

I'm ok with the logical grouping.

@BramGruneir
Copy link
Copy Markdown
Member

One last suggestion, but feel free to leave as is.


Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


pkg/ui/src/util/eventTypes.ts, line 9 at r1 (raw file):

Previously, a-robinson (Alex Robinson) wrote…

Right now it's grouped logically by the object being acted on, which seems kind of nice to me. Mind if I leave it as is?

I like the logical, but perhaps call that out and alphabetize within those groupings? The logical grouping wasn't clear to me while reviewing.


Comments from Reviewable

@a-robinson
Copy link
Copy Markdown
Contributor Author

Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


pkg/ui/src/util/eventTypes.ts, line 9 at r1 (raw file):

Previously, BramGruneir (Bram Gruneir) wrote…

I like the logical, but perhaps call that out and alphabetize within those groupings? The logical grouping wasn't clear to me while reviewing.

I'm not gonna burn another CI cycle on this, but doing it next time would be good.


Comments from Reviewable

@a-robinson
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 23, 2018

Build failed (retrying...)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 23, 2018

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request May 23, 2018
25868: sql: Log event for TRUNCATE TABLE r=a-robinson a=a-robinson

Fixes #25867

Release note (sql change): TRUNCATE TABLE commands are now logged in the
event log.

25871: ui: unbreak `make watch` r=vilterp a=vilterp

By telling Webpack to proxy the path `/` through to the Cockroach process.
Webpack used to serve `/` itself from a static file, but as of #25195 we
generate `/` dynamically in Go, so we can use it to pass login state to
the UI.

Fixes #25858

Release note: None

25875: ui: fix action names broken by #25823 r=couchand a=couchand

In that PR, I mechanically replaced identifiers when there were new
warnings about shadowing, but in two places I accidentally changed
semantics due to the shorthand form of object literals.  🤦‍♂️

Release note: None

Co-authored-by: Alex Robinson <alexdwanerobinson@gmail.com>
Co-authored-by: Pete Vilter <vilterp@cockroachlabs.com>
Co-authored-by: Andrew Couch <andrew@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 23, 2018

Build succeeded

@craig craig bot merged commit 3e1e86e into cockroachdb:master May 23, 2018
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