Skip to content

Commit

Permalink
[Refactor](docs) refactor ip functions doc (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb authored Jun 15, 2024
1 parent 3d7a227 commit 99c560e
Show file tree
Hide file tree
Showing 102 changed files with 561 additions and 1,945 deletions.
67 changes: 0 additions & 67 deletions docs/sql-manual/sql-functions/ip-functions/inet-aton.md

This file was deleted.

70 changes: 0 additions & 70 deletions docs/sql-manual/sql-functions/ip-functions/inet-ntoa.md

This file was deleted.

76 changes: 0 additions & 76 deletions docs/sql-manual/sql-functions/ip-functions/inet6-aton.md

This file was deleted.

56 changes: 0 additions & 56 deletions docs/sql-manual/sql-functions/ip-functions/inet6-ntoa.md

This file was deleted.

16 changes: 4 additions & 12 deletions docs/sql-manual/sql-functions/ip-functions/ipv4-cidr-to-range.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,19 @@ under the License.

## IPV4_CIDR_TO_RANGE

<version since="dev">

IPV4_CIDR_TO_RANGE

</version>

### description
### Description

#### Syntax

`STRUCT<IPV4, IPV4> IPV4_CIDR_TO_RANGE(IPV4 ip_v4, INT16 cidr)`

Receive an IPv4 and an Int16 value containing CIDR. Returns a struct that contains two IPv4 fields representing the lower range (min) and higher range (max) of the subnet, respectively.

### notice

`If the input parameter is NULL, return NULL, indicating invalid input`
### Example

### example

```
```sql
mysql> SELECT ipv4_cidr_to_range(ipv4_string_to_num('192.168.5.2'), 16);
+-----------------------------------------------------------+
| ipv4_cidr_to_range(ipv4_string_to_num('192.168.5.2'), 16) |
Expand All @@ -67,6 +59,6 @@ mysql> SELECT ipv4_cidr_to_range(NULL, NULL);
+--------------------------------+
```

### keywords
### Keywords

IPV4_CIDR_TO_RANGE, IP
21 changes: 10 additions & 11 deletions docs/sql-manual/sql-functions/ip-functions/ipv4-num-to-string.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,25 @@ under the License.

## IPV4_NUM_TO_STRING

<version since="dev">

IPV4_NUM_TO_STRING

</version>

### description
### Description

#### Syntax

`VARCHAR IPV4_NUM_TO_STRING(BIGINT ipv4_num)`

`VARCHAR INET_NTOA(BIGINT ipv4_num)`

Takes a Int16、Int32、Int64 number. Interprets it as an IPv4 address in big endian. Returns a string containing the corresponding IPv4 address in the format A.B.C.d (dot-separated numbers in decimal form).
### notice

`will return NULL if the input parameter is negative or larger than 4294967295(num value of '255.255.255.255')`
#### Notice

### example
Will return `NULL` if the input parameter is negative or larger than `4294967295`(num value of `'255.255.255.255'`). This function has an alias `INET_NOTA`.

```
### Example

```sql
mysql> select ipv4_num_to_string(3232235521);
+--------------------------------+
| ipv4_num_to_string(3232235521) |
Expand All @@ -65,6 +64,6 @@ mysql> select num,ipv4_num_to_string(num) from ipv4_bi;
7 rows in set (0.01 sec)
```

### keywords
### Keywords

IPV4_NUM_TO_STRING, IP
IPV4_NUM_TO_STRING, INET_NTOA, IP
Loading

0 comments on commit 99c560e

Please sign in to comment.