兼容性判定
公开资料依据 · 建议 PoC 复核支持度partial
严重度major
置信度medium
依据规则my.func.concat_ws
怎么改
显式 cast 参数并保留分隔符 NULL、参数 NULL 跳过语义后使用 concat_ws
判定说明
有同名函数,但源端隐式类型转换、collation 和返回类型仍可能不同;建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:显式 cast 参数并对分隔符 NULL 单独分支
应用侧改造
可行:展示拼接可移应用层并明确 NULL 契约
推荐路线:case_by_case。验证建议:NULL 分隔符、中间 NULL、数值/日期参数、字符集与 collation 对照
规则样例
SELECT CONCAT_WS(',', first_name, middle_name, last_name) FROM person
SELECT CONCAT_WS(NULL, a, b) FROM t
SELECT CONCAT(a, b) FROM t
参考来源
- https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_concat-ws
- https://www.postgresql.org/docs/16/functions-string.html
- https://www.postgresql.org/docs/16/datatype.html
- https://www.postgresql.org/docs/16/functions.html
- https://www.postgresql.org/docs/16/sql-commands.html
- https://github.com/tobymao/sqlglot/blob/64e268a5d95cd84a87ad74ef569fc9bf356fd3fb/README.md#unsupported-errors
相关改造点
- MYSQL → postgresql 16 全部改造点
- postgresql 16 兼容性总览
- MYSQL 迁移国产库总览
- ORACLE ADD_MONTHS 函数 迁移 postgresql 16 怎么改
- ORACLE ALTER SESSION SET 会话参数 迁移 postgresql 16 怎么改
- ORACLE ANYDATA 动态类型列 迁移 postgresql 16 怎么改
- ORACLE ASCIISTR Unicode 转义函数 迁移 postgresql 16 怎么改
- ORACLE 关联数组(INDEX BY 表) 迁移 postgresql 16 怎么改
- ORACLE AT TIME ZONE 时区表达式 迁移 postgresql 16 怎么改