Skip to content

Commit e0117f1

Browse files
committed
A cleanup for: MDEV-18010 Add classes Inet4 and Inet6
- Moving the implementations of class Inet4 and class Inet6 into separate files sql_type_inet.h and sql_type_inet.cc, in order to reuse them for the INET6 data type and inet function collection. - Adding a warning in the case when IS_IPV4_MAPPED() and IS_IPV4_COMPAT() erroneously gets an IPv4 address instead of the expected IPv6 address.
1 parent cbf6beb commit e0117f1

File tree

6 files changed

+849
-714
lines changed

6 files changed

+849
-714
lines changed

libmysqld/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
116116
../sql/sql_mode.cc
117117
../sql/sql_type_json.cc
118118
../sql/sql_type_geom.cc
119+
../sql/sql_type_inet.cc
119120
../sql/table_cache.cc ../sql/mf_iocache_encr.cc
120121
../sql/item_inetfunc.cc
121122
../sql/wsrep_dummy.cc ../sql/encryption.cc

mysql-test/main/func_misc.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,9 @@ SELECT IS_IPV4_MAPPED(INET6_ATON('1.2.3.4')),
13451345
IS_IPV4_COMPAT(INET6_ATON('1.2.3.4'));
13461346
IS_IPV4_MAPPED(INET6_ATON('1.2.3.4')) IS_IPV4_COMPAT(INET6_ATON('1.2.3.4'))
13471347
0 0
1348+
Warnings:
1349+
Warning 1292 Incorrect inet6 value: '\x01\x02\x03\x04'
1350+
Warning 1292 Incorrect inet6 value: '\x01\x02\x03\x04'
13481351
SELECT IS_IPV4_MAPPED(INET6_ATON('::1.2.3.4')),
13491352
IS_IPV4_COMPAT(INET6_ATON('::1.2.3.4'));
13501353
IS_IPV4_MAPPED(INET6_ATON('::1.2.3.4')) IS_IPV4_COMPAT(INET6_ATON('::1.2.3.4'))

sql/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ SET (SQL_SOURCE
137137
semisync_master_ack_receiver.cc
138138
sql_type.cc sql_mode.cc sql_type_json.cc
139139
sql_type_geom.cc
140+
sql_type_inet.cc
140141
item_windowfunc.cc sql_window.cc
141142
sql_cte.cc
142143
item_vers.cc

0 commit comments

Comments
 (0)