This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 25ae7cd65fa2456e197d3ce71e649fe425b0ce5a
Author: zhangstar333 <87313068+zhangstar...@users.noreply.github.com>
AuthorDate: Wed May 8 10:12:46 2024 +0800

    [bug](ipv6) the ipv6 type should be uint128_t (#34121)
    
    the ipv6 type should be uint128_t, and max value is 
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
    if use int128_t type, it's will be min value.
---
 be/src/olap/types.h                                        | 2 +-
 regression-test/data/datatype_p0/ip/test_ip_basic.out      | 7 +++++++
 regression-test/suites/datatype_p0/ip/test_ip_basic.groovy | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/types.h b/be/src/olap/types.h
index 74aa86fc49e..edc1fdabd7a 100644
--- a/be/src/olap/types.h
+++ b/be/src/olap/types.h
@@ -730,7 +730,7 @@ struct CppTypeTraits<FieldType::OLAP_FIELD_TYPE_IPV4> {
 };
 template <>
 struct CppTypeTraits<FieldType::OLAP_FIELD_TYPE_IPV6> {
-    using CppType = int128_t;
+    using CppType = uint128_t;
     using UnsignedCppType = uint128_t;
 };
 template <>
diff --git a/regression-test/data/datatype_p0/ip/test_ip_basic.out 
b/regression-test/data/datatype_p0/ip/test_ip_basic.out
index 6b17d85b832..14ecbd47a46 100644
--- a/regression-test/data/datatype_p0/ip/test_ip_basic.out
+++ b/regression-test/data/datatype_p0/ip/test_ip_basic.out
@@ -63,6 +63,12 @@ ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
 -- !sql8 --
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
 
+-- !sql8_2 --
+ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
+
+-- !sql8_3 --
+ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
+
 -- !sql9 --
 \N     0
 0.0.0.0        1
@@ -354,3 +360,4 @@ ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff     4
 120.239.82.212 2a0c:3240::1
 121.25.82.29   2620:44:a000::1
 121.25.160.80  2001:418:0:5000::c2d
+
diff --git a/regression-test/suites/datatype_p0/ip/test_ip_basic.groovy 
b/regression-test/suites/datatype_p0/ip/test_ip_basic.groovy
index f5b2620e967..650dc86ad4e 100644
--- a/regression-test/suites/datatype_p0/ip/test_ip_basic.groovy
+++ b/regression-test/suites/datatype_p0/ip/test_ip_basic.groovy
@@ -123,6 +123,8 @@ suite("test_ip_basic") {
     qt_sql6 "select ip_v6 from t0 order by ip_v6 limit 1 offset 1"
     qt_sql7 "select ip_v4 from t0 order by ip_v4 desc limit 1 offset 1"
     qt_sql8 "select ip_v6 from t0 order by ip_v6 desc limit 1 offset 1"
+    qt_sql8_2 "select ip_v6 from t0 order by ip_v6 desc limit 1 offset 1"
+    qt_sql8_3 "select ip_v6 from t0 order by ip_v6 desc limit 1 offset 1"
 
     // group by and agg
     qt_sql9 "select ip_v4, count(ip_v4) as cnt from t0 group by ip_v4 order by 
ip_v4"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to