|
| 1 | +# Copyright (c) 2021 vesoft inc. All rights reserved. |
| 2 | +# |
| 3 | +# This source code is licensed under Apache 2.0 License, |
| 4 | +# attached with Common Clause Condition 1.0, found in the LICENSES directory. |
| 5 | +Feature: Datetime insert mismatched type |
| 6 | + |
| 7 | + # issue https://github.com/vesoft-inc/nebula-graph/issues/1318 |
| 8 | + Scenario: DateTime insert mismatched type |
| 9 | + Given an empty graph |
| 10 | + And create a space with following options: |
| 11 | + | partition_num | 9 | |
| 12 | + | replica_factor | 1 | |
| 13 | + | vid_type | FIXED_STRING(30) | |
| 14 | + | charset | utf8 | |
| 15 | + | collate | utf8_bin | |
| 16 | + When executing query: |
| 17 | + """ |
| 18 | + create tag ddl_tag1(col1 date default date("2017-03-04"), |
| 19 | + col2 datetime default datetime("2017-03-04T00:00:01"), |
| 20 | + col3 time default time("11:11:11")); |
| 21 | + """ |
| 22 | + Then the execution should be successful |
| 23 | + When try to execute query: |
| 24 | + """ |
| 25 | + INSERT VERTEX ddl_tag1() VALUES 'test':() |
| 26 | + """ |
| 27 | + Then the execution should be successful |
| 28 | + When executing query: |
| 29 | + """ |
| 30 | + INSERT VERTEX ddl_tag1(col1, col2, col3) VALUES 'test':(date("2019-01-02"), date('2019-01-02'), time('11:11:11')) |
| 31 | + """ |
| 32 | + Then a ExecutionError should be raised at runtime: Storage Error: The data type does not meet the requirements. Use the correct type of data. |
| 33 | + When executing query: |
| 34 | + """ |
| 35 | + 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')) |
| 36 | + """ |
| 37 | + Then a ExecutionError should be raised at runtime: Storage Error: The data type does not meet the requirements. Use the correct type of data. |
| 38 | + When executing query: |
| 39 | + """ |
| 40 | + 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')) |
| 41 | + """ |
| 42 | + Then a ExecutionError should be raised at runtime: Storage Error: The data type does not meet the requirements. Use the correct type of data. |
| 43 | + Then drop the used space |
0 commit comments