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

Improvement(query): fix datatype different cause mysql session distroy #6150

Merged

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Jun 22, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

fix datatype different cause mysql session distroy.

Before Sundy's pr fix #5980 NULLIF function could cause MySQL session destory.

Because in Series::check_get(col)?; return a err and

  1. not finish the RowWriter.
  2. server does not send anything to the client.

So should use match arm, if find the expr return Err(e) , finish the RowWriter and then return Ok(()).

BTW, we should return Ok(()) because we should not destory the session when cause these err.

Test

I has already rollback Sundy's pr and then test on my laptop. But I don't know how to test the pr on the newest commit version.

'root'@mysqldb 21:27:39 [(none)]> set enable_planner_v2=1;
Query OK, 0 rows affected (0.03 sec)
Read 0 rows, 0.00 B in 0.002 sec., 0 rows/sec., 0.00 B/sec.

'root'@mysqldb 21:27:48 [(none)]> SELECT NULLIF(1, 1);
ERROR 1105 (HY000): Code: 1058, displayText = downcast column error, column type: "Null", expected column: "common_datavalues::columns::nullable::NullableColumn".
'root'@mysqldb 21:27:50 [(none)]> SELECT NULLIF(1, 1);
ERROR 1105 (HY000): Code: 1058, displayText = downcast column error, column type: "Null", expected column: "common_datavalues::columns::nullable::NullableColumn".
'root'@mysqldb 21:27:51 [(none)]> SELECT NULLIF(1, 1);
ERROR 1105 (HY000): Code: 1058, displayText = downcast column error, column type: "Null", expected column: "common_datavalues::columns::nullable::NullableColumn".

Changelog

  • Improvement

Related Issues

Fixes #5959

#5959 (comment)

@vercel
Copy link

vercel bot commented Jun 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Jun 22, 2022 at 3:32PM (UTC)

@mergify
Copy link
Contributor

mergify bot commented Jun 22, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@TCeason TCeason force-pushed the ISSUE-5959/mysql_session_distory branch from f77b59c to 9d05be8 Compare June 22, 2022 15:32
@sundy-li sundy-li merged commit 79742a6 into databendlabs:main Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When running SELECT NULLIF(1, 1); and SELECT NULLIF('a', 'a');, the mysql service will hang.
3 participants