Skip to content

sql/sem/builtins: mark timeofday as impure#44268

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
madelynnblue:timeofday-pure
Jan 23, 2020
Merged

sql/sem/builtins: mark timeofday as impure#44268
craig[bot] merged 1 commit intocockroachdb:masterfrom
madelynnblue:timeofday-pure

Conversation

@madelynnblue
Copy link
Copy Markdown
Contributor

@madelynnblue madelynnblue commented Jan 23, 2020

No description provided.

@madelynnblue madelynnblue requested a review from otan January 23, 2020 06:42
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @mjibson)

a discussion (no related file):
Ah what happens if we don't do this?
Also, not sure release note is necessary as timeofday hasn't been released yet.


@madelynnblue
Copy link
Copy Markdown
Contributor Author

Incorrectly marked impure functions can change how plan caching is done and maybe some other stuff? It's like a theoretical correctness issue I think.

@madelynnblue
Copy link
Copy Markdown
Contributor Author

bors r+

@madelynnblue
Copy link
Copy Markdown
Contributor Author

Oh also sqlsmith uses function purity to decide if a query can be run in two places identically.

craig bot pushed a commit that referenced this pull request Jan 23, 2020
43301: sql: fix a few issues with reporting of errors to sentry r=yuzefovich a=yuzefovich

**sql: use the correct context when recording an error for sentry**

Previously, context.Background() was used to record an internal error.
That context is missing the registered tags (e.g. 'statement' tag) which
results in an incomplete sentry report. Now this is fixed.

Release note: None

**sql: remove CloseWithErr method from CommandResultClose interface**

The behavior of CloseWithErr method can be obtained with SetError
followed by Close, so this commit does such refactoring which simplifies
the interface.

Release note: None

**sql: fix double reporting of the same error with sentry**

Previously, in a certain code path both connExecutor and pgwire would
record telemetry for the same error to be sent to sentry. This resulted
in duplicated events. Now this is fixed.

Release note: None

44246: build: fix teamcity-compose script r=mjibson a=mjibson



44250: backupccl,importccl: fix privilege checks for BACKUP/RESTORE and IMPORT r=pbardea a=pbardea

This changes the privilege checks in IMPORT, IMPORT INTO and RESTORE to
run during the *planning* of the job, in the SQL plan hook execution,
rather than during the execution of the job. This is done because
privilege checks are implemented on planner, and close over the
planner's txn in some branches/cases, so invoking them later, on a
txn-less planner in a resumed jobs execution, can cause problems.

Before this, the planStateHook's txn was assumed to be set and caused a
panic on checking RBAC privileges. Additionally, permission checks in these
operations did not properly give access to all admin users.

Fixes #44252.

Release note (bug fix): Allow all admin users to use BACKUP/RESTORE and
IMPORT.

44268: sql/sem/builtins: mark timeofday as impure r=mjibson a=mjibson



Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
Co-authored-by: Paul Bardea <pbardea@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 23, 2020

Build succeeded

@craig craig bot merged commit a60ead9 into cockroachdb:master Jan 23, 2020
@madelynnblue madelynnblue deleted the timeofday-pure branch January 23, 2020 19:12
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.

3 participants