plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/ConfigMigrateMapper.java [70:84]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    default MapperResult findConfigNeedUpdateMigrate(MapperContext context) {
        String sql = "SELECT ci.id, ci.data_id, ci.group_id, ci.tenant_id"
                + " FROM config_info ci WHERE ci.tenant_id = ? AND "
                + " (ci.src_user <> ? OR ci.src_user IS NULL) AND EXISTS "
                + " ( SELECT 1 FROM config_info ci2 WHERE ci2.data_id = ci.data_id AND ci2.group_id = ci.group_id "
                + " AND ci2.tenant_id = ? AND ci2.src_user = ? AND ci2.md5 <> ci.md5 "
                + " AND ci2.gmt_modified < ci.gmt_modified )"
                + " AND id > ?" + " ORDER BY id LIMIT ?";
        return new MapperResult(sql,
                CollectionUtils.list(context.getWhereParameter(FieldConstant.SRC_TENANT),
                        context.getWhereParameter(FieldConstant.SRC_USER),
                        context.getWhereParameter(FieldConstant.TARGET_TENANT),
                        context.getWhereParameter(FieldConstant.SRC_USER), context.getWhereParameter(FieldConstant.ID),
                        context.getPageSize()));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigMigrateMapperByDerby.java [45:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public MapperResult findConfigNeedUpdateMigrate(MapperContext context) {
        String sql = "SELECT ci.id, ci.data_id, ci.group_id, ci.tenant_id"
                + " FROM config_info ci WHERE ci.tenant_id = ? AND "
                + " (ci.src_user <> ? OR ci.src_user IS NULL) AND EXISTS "
                + " ( SELECT 1 FROM config_info ci2 WHERE ci2.data_id = ci.data_id AND ci2.group_id = ci.group_id "
                + " AND ci2.tenant_id = ? AND ci2.src_user = ? AND ci2.md5 <> ci.md5 "
                + " AND ci2.gmt_modified < ci.gmt_modified )"
                + " AND ci.id > ?" + " ORDER BY ci.id OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY";
        return new MapperResult(sql,
                CollectionUtils.list(context.getWhereParameter(FieldConstant.SRC_TENANT),
                        context.getWhereParameter(FieldConstant.SRC_USER),
                        context.getWhereParameter(FieldConstant.TARGET_TENANT),
                        context.getWhereParameter(FieldConstant.SRC_USER), context.getWhereParameter(FieldConstant.ID),
                        context.getPageSize()));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



