-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: CREATE TABLE ... AS
in implicit transaction does not use the correct sessiondata
#73249
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I was unable to automatically find someone to ping. If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Thanks for this report! I am pretty sure the problem is with |
CREATE TABLE ... AS
in implicit transaction does not use the correct sessiondata
I believe the problem is that the sessiondata is initialized to use defaults in this part of the schema changer cockroach/pkg/sql/schema_changer.go Lines 264 to 270 in 7c88d5b
I'm not sure how the sessiondata can be plumbed down to here, so moving this over to sql-schema. |
alter table zone add column c time default current_time(); Also have this problem. |
I'm inclined to move this over to @cockroachdb/bulk-io, though I have a feeling they'll be sad to have it. They have more knowledge about working with this sort of thing than anybody on schema. |
cc @cockroachdb/bulk-io |
Hm. Perhaps the SQL statements should refuse to create jobs if the session has non-default values, since they know that the job operates outside a session and thus won't match what the session would when evaluating some expressions? |
If the error could also include a hint that it would work as desired if you wrap it with |
We (somebody at CRL before me) wrote a lot of code to support CTAS in implicit transactions writing inside an async job. |
All of these problems seem to equally affect |
We could serialize the session data? |
We have marked this issue as stale because it has been inactive for |
Describe the problem
set time zone
(and other session variables) are not respected when usingCREATE TABLE ... AS
To Reproduce
Jira issue: CRDB-11496
The text was updated successfully, but these errors were encountered: