From cf6287f651f1ab66fbe75f3c515638ce5413bef9 Mon Sep 17 00:00:00 2001 From: "blake.qiu" Date: Sun, 16 Jun 2024 02:35:20 +0800 Subject: [PATCH] fix(#12231): When inserting and updating configurations in the database, the time-related field values need to be set using the time obtained from the database's built-in time function. --- .../datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java index 715a874b1f0..d7dd5d6f640 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java @@ -358,11 +358,11 @@ public void testUpdateConfigInfoAtomicCas() { MapperResult mapperResult = configInfoMapperByMySql.updateConfigInfoAtomicCas(context); Assert.assertEquals(mapperResult.getSql(), "UPDATE config_info SET " - + "content=?, md5 = ?, src_ip=?,src_user=?,gmt_modified=?, app_name=?,c_desc=?," + + "content=?, md5 = ?, src_ip=?,src_user=?,gmt_modified=CURRENT_TIMESTAMP, app_name=?,c_desc=?," + "c_use=?,effect=?,type=?,c_schema=?,encrypted_data_key=? " + "WHERE data_id=? AND group_id=? AND tenant_id=? AND (md5=? OR md5 IS NULL OR md5='')"); Assert.assertArrayEquals(mapperResult.getParamList().toArray(), - new Object[] {newContent, newMD5, srcIp, srcUser, time, appNameTmp, desc, use, effect, type, schema, + new Object[]{newContent, newMD5, srcIp, srcUser, appNameTmp, desc, use, effect, type, schema, encryptedDataKey, dataId, group, tenantId, md5}); } }