# IS\_IPV4\_MAPPED

## Syntax

```sql
IS_IPV4_MAPPED(expr)
```

## Description

Returns 1 if a given a numeric binary string IPv6 address, such as returned by [INET6\_ATON()](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/inet6_aton), is a valid IPv4-mapped address, otherwise returns 0.

{% tabs %}
{% tab title="Current" %}
When the argument is not [INET6](https://mariadb.com/docs/server/reference/data-types/string-data-types/inet6), automatic implicit [CAST](https://mariadb.com/docs/server/reference/sql-functions/string-functions/cast) to INET6 is applied. As a consequence, `IS_IPV4_MAPPED` now understands arguments in both text representation and binary(16) representation.
{% endtab %}

{% tab title="< 10.5" %}
The function understands only binary(16) representation.
{% endtab %}
{% endtabs %}

## Examples

```sql
SELECT IS_IPV4_MAPPED(INET6_ATON('::10.0.1.1'));
+------------------------------------------+
| IS_IPV4_MAPPED(INET6_ATON('::10.0.1.1')) |
+------------------------------------------+
|                                        0 |
+------------------------------------------+

SELECT IS_IPV4_MAPPED(INET6_ATON('::ffff:10.0.1.1'));
+-----------------------------------------------+
| IS_IPV4_MAPPED(INET6_ATON('::ffff:10.0.1.1')) |
+-----------------------------------------------+
|                                             1 |
+-----------------------------------------------+
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/is_ipv4_mapped.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
