# MySQL 函数与内存限制统一｜双周精选 No.73

Source: https://greptime.cn/blogs/2025-12-28-greptimedb-biweekly-report

## 内容概述

*开发周期：2025-12-15 - 2025-12-28*

**[v1.0.0-beta.4](https://github.com/GreptimeTeam/greptimedb/releases/tag/v1.0.0-beta.4) 已发布！** 本次更新支持数据库级 compaction 参数动态应用到已有表、修复了关键 bug（包括 time index 排序时的 panic 问题），以及下述功能改进。建议升级。

近期主要更新：

- 增强 MySQL 兼容性，新增更多字符串函数支持
- 统一写路径内存管理系统
- 模块化 manifest 存储架构，提升可维护性

## 贡献者

过去两周，共有 **18 位贡献者**合并了 **61 个 PR**。其中 **6 位独立贡献者**贡献了 **9 个 PR**。
欢迎新贡献者：@**[frostming](https://github.com/frostming)**！

本期活跃独立贡献者：

> - @**[McKnight22](https://github.com/McKnight22)** *[db#7280](https://github.com/GreptimeTeam/greptimedb/pull/7280)*
> - @**[AntiTopQuark](https://github.com/AntiTopQuark)** *[db#7402](https://github.com/GreptimeTeam/greptimedb/pull/7402)*
> - @**[lyang24](https://github.com/lyang24)** *[db#7459](https://github.com/GreptimeTeam/greptimedb/pull/7459)*, *[db#7399](https://github.com/GreptimeTeam/greptimedb/pull/7399)*

## PR 亮点

### [db#7454](https://github.com/GreptimeTeam/greptimedb/pull/7454) 新增 MySQL 兼容字符串函数

实现了 MySQL 中常用但 DataFusion 不支持的 LOCATE、ELT、FIELD 三个字符串函数，方便用户迁移 MySQL 工作负载。同时重构了函数别名机制，改用 DataFusion 原生的别名系统，不再维护自定义实现。

### [db#7280](https://github.com/GreptimeTeam/greptimedb/pull/7280) 统一 CLI export 存储配置

CLI export 命令改用 common 模块的 `ObjectStoreConfig`，整合了之前分散在 export 模块各处的存储配置代码，同时新增本地文件系统、S3、OSS、GCS、Azure Blob Storage 等多后端支持。

### [db#7483](https://github.com/GreptimeTeam/greptimedb/pull/7483) Manifest 存储模块化

把臃肿的 `ManifestObjectStore` 拆分为职责单一的 `DeltaStorage`、`CheckpointStorage`、`StagingStorage` 三个组件。这次重构去掉了方法签名中不优雅的 `is_staging: bool` 参数，让 `StagingStorage` 可以处理 delta manifest 之外的其他内容类型，方便后续扩展。

### [db#7402](https://github.com/GreptimeTeam/greptimedb/pull/7402) 统一数据库 compaction 选项与 TTL 行为

Compaction 选项改为调度时按 table → database → default 优先级动态解析，与 TTL 行为保持一致。建表时不再自动复制数据库级别配置到表选项，只保留显式指定的表级配置。

### [db#7408](https://github.com/GreptimeTeam/greptimedb/pull/7408), [db#7437](https://github.com/GreptimeTeam/greptimedb/pull/7437) 统一内存限制

把 `MemoryManager` 下沉到 common crate 供各模块复用，然后将原有三套重叠的内存限制机制合并为一套。新方案替换了 Frontend 中开销较大的递归大小计算和 HTTP/gRPC 服务器的自定义 `RequestMemoryLimiter`，采用 1KB 粒度分配，高并发场景下更公平。


## Good First Issue

### [Issue#7328](https://github.com/GreptimeTeam/greptimedb/issues/7328) 完善 HTTP handler 错误日志

目前部分 HTTP handler 返回非 200 响应时没有记录底层错误信息，导致生产环境排查问题困难。这个 issue 需要审查所有 HTTP handler，确保在返回错误响应前统一记录错误详情。

关键词：HTTP handler, Error logging

难度：Medium

### [Issue#7314](https://github.com/GreptimeTeam/greptimedb/issues/7314) 添加内置 daemon 模式

在 ARM64 开发板或边缘设备上运行 GreptimeDB 时，shell 会话关闭会导致进程终止。这个 issue 提议添加 `--daemon` CLI 参数，让 GreptimeDB 作为后台进程运行并脱离终端，类似 Redis 的 `daemonize yes`。这样在没有 systemd 的嵌入式系统上就不用再依赖 `nohup` 等变通方案。

关键词：CLI, daemon, edge deployment

难度：Easy
