Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5
-
None
Description
create or replace table t1 (a inet6); |
insert into t1 values ('::'),('1::1'); |
SELECT EXTRACT(DAY FROM a) FROM t1; |
10.5 b5fae7f7 |
MariaDB [test]> SELECT EXTRACT(DAY FROM a) FROM t1; |
+---------------------+ |
| EXTRACT(DAY FROM a) | |
+---------------------+ |
| 0 |
|
| 0 |
|
+---------------------+ |
2 rows in set (0.000 sec) |
With either CHAR or BINARY instead of INET6, there are warnings:
MariaDB [test]> create or replace table t1 (a char(39)); |
Query OK, 0 rows affected (0.322 sec) |
|
MariaDB [test]> insert into t1 values ('::'),('1::1'); |
Query OK, 2 rows affected (0.043 sec) |
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> SELECT EXTRACT(DAY FROM a) FROM t1; |
+---------------------+ |
| EXTRACT(DAY FROM a) | |
+---------------------+ |
| NULL | |
| 0 |
|
+---------------------+ |
2 rows in set, 2 warnings (0.000 sec) |
|
MariaDB [test]> show warnings;
|
+---------+------+----------------------------------------+ |
| Level | Code | Message | |
+---------+------+----------------------------------------+ |
| Warning | 1292 | Incorrect interval value: '::' | |
| Warning | 1292 | Truncated incorrect time value: '1::1' | |
+---------+------+----------------------------------------+ |
2 rows in set (0.000 sec) |
MariaDB [test]> create or replace table t1 (a binary(16)); |
Query OK, 0 rows affected (0.324 sec) |
|
MariaDB [test]> insert into t1 values (INET6_ATON('::')),(INET6_ATON('1::1')); |
Query OK, 2 rows affected (0.042 sec) |
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> SELECT EXTRACT(DAY FROM a) a1, EXTRACT(DAY FROM INET6_NTOA(a)) a2 FROM t1; |
+------+------+ |
| a1 | a2 |
|
+------+------+ |
| NULL | NULL | |
| NULL | 0 | |
+------+------+ |
2 rows in set, 4 warnings (0.000 sec) |
|
MariaDB [test]> show warnings;
|
+---------+------+----------------------------------------------------------------------------------------------+ |
| Level | Code | Message | |
+---------+------+----------------------------------------------------------------------------------------------+ |
| Warning | 1292 | Incorrect interval value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | |
| Warning | 1292 | Incorrect interval value: '::' | |
| Warning | 1292 | Incorrect interval value: '\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01' | |
| Warning | 1292 | Truncated incorrect time value: '1::1' | |
+---------+------+----------------------------------------------------------------------------------------------+ |
4 rows in set (0.000 sec) |
Attachments
Issue Links
- relates to
-
MDEV-274 The data type for IPv6/IPv4 addresses in MariaDB
- Closed
-
MDEV-20784 Testing for MDEV-274 (INET6, data type for IPv6/IPv4 addresses)
- Closed