兼容性判定
公开资料依据 · 建议 PoC 复核支持度partial
严重度critical
置信度medium
依据规则my.func.find_in_set
怎么改
array_position(string_to_array(list, ','), value),长期拆关联表
判定说明
可改写但 1 基位置、未找到 0、NULL 与逗号值语义需建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:临时按 array_position 重写,长期拆关联表并建索引
应用侧改造
可行:写入侧停止逗号拼接并迁移结构化集合
推荐路线:db_side。验证建议:首项、末项、未找到、NULL、空串、重复值和含逗号值回归
规则样例
SELECT FIND_IN_SET('b', 'a,b,c')
SELECT * FROM user_tag WHERE FIND_IN_SET(tag, tag_list) > 0
SELECT POSITION('b' IN 'a,b,c')
参考来源
- https://dev.mysql.com/doc/refman/8.4/en/string-functions.html
- https://www.postgresql.org/docs/16/functions-array.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/darold/ora2pg/blob/97015451a4d1cfbee888f2e6efe7ff68c239a9b5/lib/Ora2Pg/PLSQL.pm#L3132-L3160
相关改造点
- 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 怎么改