Skip to content

[fix](docs) ipv6_cidr_to_range examples error on 4.x/dev (INET6_ATON -> to_ipv6) + reserved-word alias + truncated IPv6#3914

Merged
csun5285 merged 1 commit into
apache:masterfrom
boluor:fix/ipv6-cidr-to-range-to-ipv6
Jun 6, 2026
Merged

[fix](docs) ipv6_cidr_to_range examples error on 4.x/dev (INET6_ATON -> to_ipv6) + reserved-word alias + truncated IPv6#3914
csun5285 merged 1 commit into
apache:masterfrom
boluor:fix/ipv6-cidr-to-range-to-ipv6

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented Jun 6, 2026

Problem

On the dev (current) and 4.x trees, every example on
ipv6_cidr_to_range wraps the input in INET6_ATON('...'). The value
INET6_ATON returns is rejected by ipv6_cidr_to_range, so on both 4.1.1
and master the examples error instead of producing the documented output:

SELECT ipv6_cidr_to_range(INET6_ATON('2001:db8::1'), 64);
ERROR 1105 (HY000): errCode = 2, detailMessage = (127.0.0.1)[INVALID_ARGUMENT]Invalid IPv6 value

The 2.1/3.x docs use the working to_ipv6('...') form.

Fix (dev + 4.x, EN + ZH)

  • INET6_ATON(...)to_ipv6(...) so the examples run.
  • as rangeas `range`range is a reserved keyword and otherwise
    fails to parse (mismatched input 'range').
  • ZH /48 example: the expected max was truncated by one group
    (2001:db8:1:ffff:ffff:ffff:ffff2001:db8:1:ffff:ffff:ffff:ffff:ffff); the
    EN doc was already correct.

Verification

Ran every example on the page end-to-end against a live Apache Doris 4.1.1
cluster (dev tree verified against it too): all pass. The /48 range now returns
the full address on both languages:

SELECT ipv6_cidr_to_range(to_ipv6('2001:db8:1::1'), 48) as `range`;
+---------------------------------------------------------------------+
| {"min":"2001:db8:1::", "max":"2001:db8:1:ffff:ffff:ffff:ffff:ffff"} |
+---------------------------------------------------------------------+

The out-of-range example still raises Illegal cidr value '129' as documented.

…-> to_ipv6) + fix reserved-word alias and a truncated IPv6

The ipv6-cidr-to-range examples in the dev (current) and 4.x trees were rewritten
to wrap the input in INET6_ATON(), whose return type is rejected by
ipv6_cidr_to_range with "[INVALID_ARGUMENT]Invalid IPv6 value" on both 4.1.1 and
master, so none of the examples on the page actually run. The 2.1/3.x docs use the
working to_ipv6() form. This restores to_ipv6() on dev + 4.x (EN + ZH).

Also:
- `as range` fails to parse because `range` is a reserved keyword
  ("mismatched input 'range'"); quote it as `` as `range` ``.
- ZH /48 example: the expected max address was truncated by one group
  (`2001:db8:1:ffff:ffff:ffff:ffff` -> `2001:db8:1:ffff:ffff:ffff:ffff:ffff`);
  EN was already correct. Fixed ZH to match the cluster.

Verified end-to-end on a live 4.1.1 cluster (and dev tree against it): all examples
pass (P3 F0); the single warn is the doc's intentional `(...)` elision of the host
prefix in the out-of-range "Illegal cidr value '129'" error example.
@csun5285 csun5285 merged commit 0d466b7 into apache:master Jun 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants