Skip to content
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

【Bug?】The behavior of the UPDATE statement using the CASE clause is wrong #314

Closed
MarkMpn opened this issue Jun 26, 2023 Discussed in #313 · 0 comments · Fixed by #319
Closed

【Bug?】The behavior of the UPDATE statement using the CASE clause is wrong #314

MarkMpn opened this issue Jun 26, 2023 Discussed in #313 · 0 comments · Fixed by #319

Comments

@MarkMpn
Copy link
Owner

MarkMpn commented Jun 26, 2023

Discussed in #313

Originally posted by hiroyuki0415 June 26, 2023
I have the following data:

 crf3c_rank0_3idcrf3c_integer_column
 2f0384fb-5b14-ee11-9cbe-002248627e121
 63aecf0d-5c14-ee11-9cbe-002248627e121
 13a93ef8-5b14-ee11-9cbe-002248627ef11
 b51e0406-5c14-ee11-9cbe-002248627ef11
 08a15f0d-5c14-ee11-9cbe-002248627ef11

After executing the following UPDATE, all the values ​​in the [crf3c_integer_column] column are NULL.
Isn't this a bug?

UPDATE r
SET r.crf3c_integer_column = (
		CASE 
			WHEN r.crf3c_integer_column IS NULL
				THEN NULL
			ELSE r.crf3c_integer_column + 1
			END
		)
FROM crf3c_rank0_3 AS r
WHERE r.crf3c_rank0_3id IS NOT NULL;

The result is below:

 crf3c_rank0_3idcrf3c_integer_column
 2f0384fb-5b14-ee11-9cbe-002248627e12NULL
 63aecf0d-5c14-ee11-9cbe-002248627e12NULL
 13a93ef8-5b14-ee11-9cbe-002248627ef1NULL
 b51e0406-5c14-ee11-9cbe-002248627ef1NULL
 08a15f0d-5c14-ee11-9cbe-002248627ef1NULL

Thanks in advance for your support.

MarkMpn added a commit that referenced this issue Jun 28, 2023
MarkMpn added a commit that referenced this issue Jun 28, 2023
@MarkMpn MarkMpn linked a pull request Jul 10, 2023 that will close this issue
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 a pull request may close this issue.

1 participant