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: expression branch wrap_nullable #9459

Closed
1 of 2 tasks
TCeason opened this issue Jan 4, 2023 · 1 comment
Closed
1 of 2 tasks

bug: expression branch wrap_nullable #9459

TCeason opened this issue Jan 4, 2023 · 1 comment
Labels
C-bug Category: something isn't working new-expression

Comments

@TCeason
Copy link
Collaborator

TCeason commented Jan 4, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Version

expression branch

What's Wrong?

wrap_nullable will wrap the nullable type and get the inner value. If the inner value is null , will use default value.

How to Reproduce?

CREATE TABLE t1(s String NULL, pat String NULL, pos Int64 NULL, occu Int64 NULL, ro Int64 NULL, mt String NULL) Engine = Fuse;

INSERT INTO t1 (s, pat, pos, occu, ro, mt) VALUES ('dog cat dog', 'dog', NULL, 1, 1, 'c');

SELECT s FROM t1 WHERE REGEXP_INSTR(s, pat, pos, occu, ro, mt) = 4;
ERROR 1105 (HY000): result row write failed: Code: 1001, displayText = Incorrect arguments to regexp_instr: position must be positive, but got 0.

expect result : NULL.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@TCeason TCeason added the C-bug Category: something isn't working label Jan 4, 2023
TCeason added a commit that referenced this issue Jan 4, 2023
#9459

tmp modify the test.
@TCeason
Copy link
Collaborator Author

TCeason commented Mar 9, 2023

mysql> CREATE TABLE t1(s String NULL, pat String NULL, pos Int64 NULL, occu Int64 NULL, ro Int64 NULL, mt String NULL) Engine = Fuse;

INSERT INTO t1 (s, pat, pos, occu, ro, mt) VALUES ('dog cat dog', 'dog', NULL, 1, 1, 'c');

SELECT s FROM t1 WHERE REGEXP_INSTR(s, pat, pos, occu, ro, mt) = 4;
Query OK, 0 rows affected (0.05 sec)

Query OK, 1 row affected (0.03 sec)

Empty set (0.03 sec)
Read 0 rows, 0.00 B in 0.006 sec., 0 rows/sec., 0.00 B/sec.

mysql> 

I think this issue can be close.

@TCeason TCeason closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working new-expression
Projects
None yet
Development

No branches or pull requests

2 participants