You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: IPv4-mapped IPv6 addresses lose their mapped identity #28216
IS_IPV4_MAPPED() itself returns 1 for an explicit 16-byte mapped value, proving that INET6_ATON() loses the prefix before classification. Constants and column values reproduce identically in three runs.
Expected Behavior
An IPv4-mapped IPv6 address must remain a 16-byte IPv6 value through parsing and formatting. IS_IPV6() and IS_IPV4_MAPPED() must classify it as IPv6 and mapped respectively.
INET6_ATON calls ip.To4() and returns the four-byte result for mapped IPv6 input. INET6_NTOA explicitly formats mapped 16-byte input through ip4.String(). IS_IPV6 rejects every parsed address whose To4() is non-nil.
PR #28800 preserves IPv4-mapped IPv6 values as 16-byte addresses through INET6_ATON, formats them with the ::ffff: prefix, and aligns IPv4/IPv6 classification with the address identity. Scalar, vector, and generated-column expectations are covered. The PR is open; local UT/BVT were not run because the isolated worktree lacks provenance-validated CGo artifacts, and exact-head CI is still running.
Activity
Ariznawlll commentedon Sep 8, 2026
在最新
mainf72ca9efbeb3a7c673701e4a135cc6670c33cfde上重新覆盖了 IPv4-mapped IPv6 的常量、列值和函数组合,三轮行为一致:显式 16 字节输入上的
IS_IPV4_MAPPED(...)仍正确返回1,普通 4 字节 IPv4、普通 16 字节 IPv6、IPv4-compatible IPv6 以及非法二进制长度的控制行为也正常。问题仍是 mapped 地址在字符串解析和格式化路径中被To4()折叠,未扩展到 mapped 前缀判定本身。Ariznawlll commentedon Sep 12, 2026
在当前
main6875e4203519de1ed98b842c1cbc8c57f11dc326上补充覆盖了 IPv4-mapped IPv6 的 PreparedStatement、两 CN、列值、View 和 CTAS 路径,三轮结果一致。同一映射地址的展开写法
0:0:0:0:0:ffff:192.0.2.1也被折叠为相同的 4 字节值。普通 IPv4、IPv4-compatible IPv6(::192.0.2.1)和普通 IPv6 控制值保持各自预期的 4/16 字节表示。该折叠会继续传播到 View 和 CTAS 的结果列,使映射地址无法被
IS_IPV4_MAPPED(INET6_ATON(ip_text)) = 1筛选出来;MySQL 该筛选命中 mapped 行,而 MatrixOne 没有命中。XuPeng-SH commentedon Sep 12, 2026
PR #28800 preserves IPv4-mapped IPv6 values as 16-byte addresses through INET6_ATON, formats them with the ::ffff: prefix, and aligns IPv4/IPv6 classification with the address identity. Scalar, vector, and generated-column expectations are covered. The PR is open; local UT/BVT were not run because the isolated worktree lacks provenance-validated CGo artifacts, and exact-head CI is still running.
fix: correct IPv4 and IPv6 function semantics (#28800)
Ariznawlll commentedon Sep 15, 2026
测试版本
main:0c3a04f390adaf6281fd592a49778ea5b1155e67原问题验证
IPv4-mapped IPv6 在
INET6_ATON/INET6_NTOA往返后仍保留::ffff:mapped 语义。Happy Path 覆盖
覆盖
::ffff:192.168.1.1二进制转换、文本往返与 mapped 分类。Unhappy Path 覆盖
与 IPv4-compatible、普通 IPv6 路径对照,确认不发生类别混淆。
白盒验证
不适用:由公开 SQL 函数的往返结果覆盖。
回归测试
已加入 MOTR:
issue_28214_28217_ipv4_semantics,见 motr#176。测试证据
新 MOTR 用例连续运行 3 轮成功,mapped 地址输出与分类稳定正确。
测试结论
测试通过。
fix: correct IPv4 and IPv6 function semantics (matrixorigin#28800)
fix: correct IPv4 and IPv6 function semantics (matrixorigin#28800)
fix: correct IPv4 and IPv6 function semantics (matrixorigin#28800)