forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the error which insert mismatched datetime type (vesoft-inc#15)
* Fix the error which insert mismatched datetime type. * Add test cases. Co-authored-by: Shylock Hg <[email protected]>
- Loading branch information
1 parent
fcf2f42
commit 17e9f19
Showing
3 changed files
with
47 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
tests/tck/features/bugfix/InsertMismatchedTypeDateTime.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) 2021 vesoft inc. All rights reserved. | ||
# | ||
# This source code is licensed under Apache 2.0 License, | ||
# attached with Common Clause Condition 1.0, found in the LICENSES directory. | ||
Feature: Datetime insert mismatched type | ||
|
||
# issue https://github.com/vesoft-inc/nebula-graph/issues/1318 | ||
Scenario: DateTime insert mismatched type | ||
Given an empty graph | ||
And create a space with following options: | ||
| partition_num | 9 | | ||
| replica_factor | 1 | | ||
| vid_type | FIXED_STRING(30) | | ||
| charset | utf8 | | ||
| collate | utf8_bin | | ||
When executing query: | ||
""" | ||
create tag ddl_tag1(col1 date default date("2017-03-04"), | ||
col2 datetime default datetime("2017-03-04T00:00:01"), | ||
col3 time default time("11:11:11")); | ||
""" | ||
Then the execution should be successful | ||
When try to execute query: | ||
""" | ||
INSERT VERTEX ddl_tag1() VALUES 'test':() | ||
""" | ||
Then the execution should be successful | ||
When executing query: | ||
""" | ||
INSERT VERTEX ddl_tag1(col1, col2, col3) VALUES 'test':(date("2019-01-02"), date('2019-01-02'), time('11:11:11')) | ||
""" | ||
Then a ExecutionError should be raised at runtime: Storage Error: The data type does not meet the requirements. Use the correct type of data. | ||
When executing query: | ||
""" | ||
INSERT VERTEX ddl_tag1(col1, col2, col3) VALUES 'test':(datetime("2019-01-02T00:00:00"), datetime('2019-01-02T00:00:00'), time('11:11:11')) | ||
""" | ||
Then a ExecutionError should be raised at runtime: Storage Error: The data type does not meet the requirements. Use the correct type of data. | ||
When executing query: | ||
""" | ||
INSERT VERTEX ddl_tag1(col1, col2, col3) VALUES 'test':(date("2019-01-02"), datetime('2019-01-02T00:00:00'), datetime('2019-01-02T11:11:11')) | ||
""" | ||
Then a ExecutionError should be raised at runtime: Storage Error: The data type does not meet the requirements. Use the correct type of data. | ||
Then drop the used space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters