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]: DATE cannot be converted to BIGINT in CAST #3293

Closed
1 task done
domingozhang opened this issue Jun 23, 2022 · 8 comments
Closed
1 task done

[Bug]: DATE cannot be converted to BIGINT in CAST #3293

domingozhang opened this issue Jun 23, 2022 · 8 comments
Assignees
Labels
bvt error occurred during bvt test kind/bug Something isn't working priority/p0 Critical feature that should be implemented in this version triage/accepted
Milestone

Comments

@domingozhang
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

select cast(cast(0x13488c5 as signed) as date);
Operator 'cast' with parameters [BIGINT DATE] will be implemented in future version.

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

@domingozhang domingozhang added kind/bug Something isn't working needs-triage bvt error occurred during bvt test labels Jun 23, 2022
@domingozhang domingozhang added this to the v0.5.0 milestone Jun 23, 2022
@JinHai-CN JinHai-CN added the wontfix This will not be worked on label Jun 24, 2022
@yingfeng
Copy link
Contributor

Similar issue but with panic:

mysql> select cast('2020-02-01' as date) + NULL;
ERROR 1105 (HY000): function doesn't implement its eval method
mysql> select 1+NULL;
ERROR 1105 (HY000): Internal error: panic runtime error: index out of range [0] with length 0: goroutine 274 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x68
github.com/matrixorigin/matrixone/pkg/common/moerr.NewPanicError({0x104186c00?, 0x14004db49a8})
	/Users/yingfeng/codebase/matrixorigin/matrixone/pkg/common/moerr/error.go:91 +0x50
github.com/matrixorigin/matrixone/pkg/frontend.(*MysqlCmdExecutor).ExecRequest.func1()

@JinHai-CN
Copy link
Contributor

A proper error message should be given.

@JinHai-CN JinHai-CN modified the milestones: v0.5.0, v0.6.0 Jun 30, 2022
@JinHai-CN
Copy link
Contributor

Similar issue but with panic:

mysql> select cast('2020-02-01' as date) + NULL;
ERROR 1105 (HY000): function doesn't implement its eval method
mysql> select 1+NULL;
ERROR 1105 (HY000): Internal error: panic runtime error: index out of range [0] with length 0: goroutine 274 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x68
github.com/matrixorigin/matrixone/pkg/common/moerr.NewPanicError({0x104186c00?, 0x14004db49a8})
	/Users/yingfeng/codebase/matrixorigin/matrixone/pkg/common/moerr/error.go:91 +0x50
github.com/matrixorigin/matrixone/pkg/frontend.(*MysqlCmdExecutor).ExecRequest.func1()

No, they are different. These two cases is about NULL handling.

And second statement is correct, now.

mysql> select 1+NULL;
+----------+
| 1 + null |
+----------+
| NULL |
+----------+

@yingfeng
Copy link
Contributor

panic has been fixed already

@domingozhang
Copy link
Contributor Author

need an error code in 0.6

@aressu1985 aressu1985 added the severity/s1 High impact: Logical errors or data errors that must occur label Aug 10, 2022
@sukki37 sukki37 assigned domingozhang and unassigned JinHai-CN Oct 29, 2022
@sukki37
Copy link
Contributor

sukki37 commented Oct 29, 2022

@domingozhang can update the status

@domingozhang
Copy link
Contributor Author

date to int will not be converted. error code will be normalized in future

@domingozhang domingozhang modified the milestones: v0.6.0, Backlog Oct 29, 2022
@domingozhang domingozhang added priority/p1 Medium priority feature that should be implemented in this version and removed severity/s1 High impact: Logical errors or data errors that must occur labels Nov 21, 2022
@fengttt fengttt assigned daviszhen and unassigned domingozhang Feb 9, 2023
@fengttt fengttt removed wontfix This will not be worked on priority/p1 Medium priority feature that should be implemented in this version labels Feb 9, 2023
@fengttt fengttt added the priority/p0 Critical feature that should be implemented in this version label Feb 9, 2023
@fengttt fengttt modified the milestones: Backlog, V0.8.0-Backlog Feb 9, 2023
@daviszhen
Copy link
Contributor

daviszhen commented Feb 14, 2023

MO do not support the conversion DATE => BIGINT base on the doc : https://doc.weixin.qq.com/sheet/e3_AdIAkQb_AEYGT3QVZBJQXqJghCjYF?scode=AJsA6gc3AA840KbtsHAAgAkgYHABU&tab=s8bwcy

We can close the issue.

@daviszhen daviszhen assigned domingozhang and unassigned daviszhen Feb 14, 2023
@domingozhang domingozhang modified the milestones: V0.8.0-Backlog, Backlog Mar 1, 2023
@domingozhang domingozhang removed their assignment Oct 10, 2023
@matrix-meow matrix-meow self-assigned this Oct 10, 2023
@zengyan1 zengyan1 assigned zengyan1 and unassigned matrix-meow Oct 11, 2023
@zengyan1 zengyan1 modified the milestones: Backlog, 1.1.0 Oct 12, 2023
@florashi181 florashi181 modified the milestones: 1.1.0, Backlog Oct 16, 2023
@fengttt fengttt modified the milestones: Backlog, 2.1.0 Oct 29, 2024
@sukki37 sukki37 closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bvt error occurred during bvt test kind/bug Something isn't working priority/p0 Critical feature that should be implemented in this version triage/accepted
Projects
None yet
Development

No branches or pull requests