@@ -82,4 +82,50 @@ suite("test_insert_default_value") {
82
82
qt_select2 """ select k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11 from test_insert_dft_tbl """
83
83
84
84
sql " drop table test_insert_dft_tbl"
85
- }
85
+
86
+ sql " drop table if exists test_insert_default_null"
87
+ sql """
88
+ CREATE TABLE `test_insert_default_null` (
89
+ `gz_organization_id` int(11) DEFAULT '1',
90
+ `company_id` int(11) NOT NULL,
91
+ `material_id` varchar(120) NOT NULL COMMENT '素材id',
92
+ `material_info_type` varchar(40) DEFAULT '',
93
+ `signature` varchar(260) DEFAULT '' COMMENT 'md5',
94
+ `size` int(11) DEFAULT '0' COMMENT '大小',
95
+ `width` int(11) DEFAULT '0' COMMENT '宽',
96
+ `height` int(11) DEFAULT '0' COMMENT '高',
97
+ `format` varchar(80) DEFAULT '' COMMENT '格式',
98
+ `upload_time` datetime DEFAULT NULL COMMENT '上传时间',
99
+ `filename` varchar(500) DEFAULT '' COMMENT '名字',
100
+ `duration` decimal(10,1) DEFAULT '0' COMMENT '视频时长',
101
+ `producer_name` varchar(200) DEFAULT '',
102
+ `producer_id` int(11) DEFAULT '0',
103
+ `producer_department_path` varchar(100) DEFAULT '',
104
+ `producer_special_id` int(11) DEFAULT '0',
105
+ `producer_node_id` int(11) DEFAULT '0',
106
+ `update_time` datetime DEFAULT null,
107
+ `create_time` datetime DEFAULT null,
108
+ INDEX idx_filename(filename) USING INVERTED PROPERTIES("parser" = "chinese"),
109
+ ) ENGINE=OLAP
110
+ UNIQUE KEY(`gz_organization_id`, `company_id`, `material_id`)
111
+ DISTRIBUTED BY HASH(`material_id`) BUCKETS 3
112
+ PROPERTIES (
113
+ "store_row_column" = "true",
114
+ "enable_unique_key_merge_on_write" = "true",
115
+ "replication_num" = "1"
116
+ );
117
+ """
118
+
119
+ sql """ set enable_nereids_planner=true """
120
+ sql """ set enable_nereids_dml=true """
121
+ sql """ INSERT INTO `test_insert_default_null` (gz_organization_id, `company_id`, `material_id`, create_time) VALUES ('1', '2', 'test', DEFAULT); """
122
+ qt_select3 """ select * from test_insert_default_null;"""
123
+ sql """ truncate table test_insert_default_null;"""
124
+
125
+ sql """ set enable_nereids_planner=false """
126
+ sql """ set enable_nereids_dml=false """
127
+ sql """ INSERT INTO `test_insert_default_null` (gz_organization_id, `company_id`, `material_id`, create_time) VALUES ('1', '2', 'test', DEFAULT); """
128
+
129
+ qt_select4 """ select * from test_insert_default_null;"""
130
+ sql " drop table if exists test_insert_default_null"
131
+ }
0 commit comments