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

should verify the type mismatch when insert or update #4842

Closed
nebula-bots opened this issue Nov 9, 2022 · 1 comment
Closed

should verify the type mismatch when insert or update #4842

nebula-bots opened this issue Nov 9, 2022 · 1 comment
Assignees
Labels
affects/master PR/issue: this bug affects master version. auto-sync find/automation need to discuss Solution: issue or PR without a clear conclusion on whether to handle it process/done Process of bug severity/minor Severity of bug type/bug/correctness Query runs normaly but produces wrong results. type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Milestone

Comments

@nebula-bots
Copy link
Contributor

if the type of property is datetime, and then insert or update with string, should be prevented by graph validator.

actual:
send to storaged.

should be SemanticError not storage error

(root@nebula) [sf100]>  update vertex on Person 933 set firstName=23 when firstName == "harris"
Execution succeeded (time spent 592/14224 us)

Wed, 09 Nov 2022 16:31:08 CST

(root@nebula) [sf100]>  update vertex on Person 933 set firstName=23
[ERROR (-1005)]: Storage Error: Invalid data, may be wrong value type.

Wed, 09 Nov 2022 16:31:51 CST


(root@nebula) [sf100]> desc tag Person
+----------------+----------+-------+---------+---------+
| Field          | Type     | Null  | Default | Comment |
+----------------+----------+-------+---------+---------+
| "firstName"    | "string" | "YES" |         |         |
| "lastName"     | "string" | "YES" |         |         |
| "gender"       | "string" | "YES" |         |         |
| "birthday"     | "string" | "YES" |         |         |
| "creationDate" | "string" | "YES" |         |         |
| "locationIP"   | "string" | "YES" |         |         |
| "browserUsed"  | "string" | "YES" |         |         |
+----------------+----------+-------+---------+---------+
Got 7 rows (time spent 629/13654 us)

Wed, 09 Nov 2022 16:41:35 CST
(root@nebula) [sf100]> INSERT VERTEX t5(p1, p2, p3) VALUES 1:("Abe", 2, 3);
Execution succeeded (time spent 1070/13328 us)

Wed, 09 Nov 2022 16:34:06 CST

(root@nebula) [sf100]> INSERT VERTEX t5(p1, p2, p3) VALUES 1:("Abe", "2", 3);
[ERROR (-1005)]: Storage Error: The data type does not meet the requirements. Use the correct type of data.
@nebula-bots nebula-bots added auto-sync severity/none Severity of bug type/bug Type: something is unexpected type/bug/correctness Query runs normaly but produces wrong results. labels Nov 9, 2022
@nebula-bots nebula-bots added the severity/minor Severity of bug label Nov 10, 2022
@jinyingsunny jinyingsunny added severity/minor Severity of bug and removed severity/minor Severity of bug severity/none Severity of bug labels Nov 10, 2022
@Sophie-Xie Sophie-Xie added this to the v3.4.0 milestone Nov 11, 2022
@Sophie-Xie Sophie-Xie assigned MuYiYong and dutor and unassigned veezhang and MuYiYong Nov 28, 2022
@HarrisChu HarrisChu added the affects/none PR/issue: this bug affects none version. label Dec 1, 2022
@dutor
Copy link
Contributor

dutor commented Dec 1, 2022

IMO, This should have been handled by the query engine. But given the fact that all of the type checking in INSERT or UPDATE is fallen into the storage layer, the refactoring work is considerable.
Better to let it go at the moment.

@Sophie-Xie Sophie-Xie added the need to discuss Solution: issue or PR without a clear conclusion on whether to handle it label Dec 1, 2022
@Sophie-Xie Sophie-Xie assigned MuYiYong and dutor and unassigned dutor Dec 2, 2022
@nebula-bots nebula-bots added affects/master PR/issue: this bug affects master version. find/automation process/fixed Process of bug wontfix Solution: this will not be worked on recently and removed affects/none PR/issue: this bug affects none version. labels Dec 6, 2022
@nebula-bots nebula-bots added process/done Process of bug and removed process/fixed Process of bug labels Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/master PR/issue: this bug affects master version. auto-sync find/automation need to discuss Solution: issue or PR without a clear conclusion on whether to handle it process/done Process of bug severity/minor Severity of bug type/bug/correctness Query runs normaly but produces wrong results. type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Projects
None yet
Development

No branches or pull requests

7 participants