From ee7c6ffb8fa99303271c54a327094fbb6b3cc475 Mon Sep 17 00:00:00 2001 From: xiteming Date: Thu, 26 Aug 2021 10:32:24 +0800 Subject: [PATCH] min max support ip --- src/common/backend/catalog/builtin_funcs.ini | 20 +- src/common/backend/utils/adt/network.cpp | 23 ++ src/common/backend/utils/init/globals.cpp | 2 +- src/include/catalog/pg_aggregate.h | 2 + .../rollback-post_catalog_maindb_92_304.sql | 1 + .../rollback-post_catalog_maindb_92_308.sql | 4 + .../rollback-post_catalog_otherdb_92_308.sql | 4 + .../upgrade-post_catalog_maindb_92_304.sql | 2 +- .../upgrade-post_catalog_maindb_92_308.sql | 25 ++ .../upgrade-post_catalog_otherdb_92_304.sql | 2 +- .../upgrade-post_catalog_otherdb_92_308.sql | 25 ++ src/include/utils/builtins.h | 2 + .../regress/expected/min_max_support_IP.out | 240 ++++++++++++++++++ .../expected/single_node_opr_sanity.out | 4 + src/test/regress/parallel_schedule0 | 4 + src/test/regress/sql/min_max_support_IP.sql | 144 +++++++++++ 16 files changed, 496 insertions(+), 8 deletions(-) create mode 100644 src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_308.sql create mode 100644 src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_308.sql create mode 100644 src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_308.sql create mode 100644 src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_308.sql create mode 100644 src/test/regress/expected/min_max_support_IP.out create mode 100644 src/test/regress/sql/min_max_support_IP.sql diff --git a/src/common/backend/catalog/builtin_funcs.ini b/src/common/backend/catalog/builtin_funcs.ini index c7e2f9c3..5f63bb06 100755 --- a/src/common/backend/catalog/builtin_funcs.ini +++ b/src/common/backend/catalog/builtin_funcs.ini @@ -6005,7 +6005,7 @@ AddBuiltinFunc(_0(697), _1("masklen"), _2(1), _3(true), _4(false), _5(network_masklen), _6(23), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_masklen"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) ), AddFuncGroup( - "max", 22, + "max", 23, AddBuiltinFunc(_0(2050), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(2277), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 2277), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(2115), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(20), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 20), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(2116), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(23), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 23), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), @@ -6027,8 +6027,9 @@ AddBuiltinFunc(_0(2797), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(27), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 27), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(3526), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(3500), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 3500), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(5538), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(5545), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 5545), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), - AddBuiltinFunc(_0(9010), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(9003), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 9003), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) - ), + AddBuiltinFunc(_0(9010), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(9003), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 9003), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), + AddBuiltinFunc(_0(6668), _1("max"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(869), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), + ), AddFuncGroup( "md5", 2, AddBuiltinFunc(_0(2311), _1("md5"), _2(1), _3(true), _4(false), _5(md5_text), _6(25), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 25), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("md5_text"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), @@ -6052,7 +6053,7 @@ AddBuiltinFunc(_0(5559), _1("median_transfn"), _2(2), _3(false), _4(false), _5(median_transfn), _6(2281), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(2, 2281, 2276), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("median_transfn"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false)), ), AddFuncGroup( - "min", 21, + "min", 22, AddBuiltinFunc(_0(2051), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(2277), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 2277), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(2131), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(20), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 20), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(2132), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(23), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 23), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), @@ -6073,7 +6074,8 @@ AddBuiltinFunc(_0(2245), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(1042), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 1042), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(2798), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(27), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 27), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), AddBuiltinFunc(_0(3527), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(3500), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 3500), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), - AddBuiltinFunc(_0(9009), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(9003), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 9003), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) + AddBuiltinFunc(_0(9009), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(9003), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 9003), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')), + AddBuiltinFunc(_0(6669), _1("min"), _2(1), _3(false), _4(false), _5(aggregate_dummy), _6(869), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(true), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(1, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("aggregate_dummy"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) ), AddFuncGroup( "mktinterval", 1, @@ -6235,6 +6237,10 @@ "network_gt", 1, AddBuiltinFunc(_0(923), _1("network_gt"), _2(2), _3(true), _4(false), _5(network_gt), _6(16), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(true), _18('i'), _19(0), _20(2, 869, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_gt"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) ), + AddFuncGroup( + "network_larger", 1, + AddBuiltinFunc(_0(6666), _1("network_larger"), _2(2), _3(true), _4(false), _5(network_larger), _6(869), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(2, 869, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_larger"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) + ), AddFuncGroup( "network_le", 1, AddBuiltinFunc(_0(922), _1("network_le"), _2(2), _3(true), _4(false), _5(network_le), _6(16), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(true), _18('i'), _19(0), _20(2, 869, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_le"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) @@ -6247,6 +6253,10 @@ "network_ne", 1, AddBuiltinFunc(_0(925), _1("network_ne"), _2(2), _3(true), _4(false), _5(network_ne), _6(16), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(true), _18('i'), _19(0), _20(2, 869, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_ne"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) ), + AddFuncGroup( + "network_smaller", 1, + AddBuiltinFunc(_0(6667), _1("network_smaller"), _2(2), _3(true), _4(false), _5(network_smaller), _6(869), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(2, 869, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_smaller"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) + ), AddFuncGroup( "network_sub", 1, AddBuiltinFunc(_0(927), _1("network_sub"), _2(2), _3(true), _4(false), _5(network_sub), _6(16), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(0), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('i'), _19(0), _20(2, 869, 869), _21(NULL), _22(NULL), _23(NULL), _24(NULL), _25("network_sub"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) diff --git a/src/common/backend/utils/adt/network.cpp b/src/common/backend/utils/adt/network.cpp index cb60c1df..5c130869 100644 --- a/src/common/backend/utils/adt/network.cpp +++ b/src/common/backend/utils/adt/network.cpp @@ -471,7 +471,30 @@ Datum network_ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(network_cmp_internal(a1, a2) != 0); } +/* + * MIN/MAX support functions. + */ +Datum network_smaller(PG_FUNCTION_ARGS) +{ + inet *a1 = PG_GETARG_INET_PP(0); + inet *a2 = PG_GETARG_INET_PP(1); + if (network_cmp_internal(a1, a2) < 0) + PG_RETURN_INET_P(a1); + else + PG_RETURN_INET_P(a2); +} + +Datum network_larger(PG_FUNCTION_ARGS) +{ + inet *a1 = PG_GETARG_INET_PP(0); + inet *a2 = PG_GETARG_INET_PP(1); + + if (network_cmp_internal(a1, a2) > 0) + PG_RETURN_INET_P(a1); + else + PG_RETURN_INET_P(a2); +} /* * Support function for hash indexes on inet/cidr. */ diff --git a/src/common/backend/utils/init/globals.cpp b/src/common/backend/utils/init/globals.cpp index a6597fc2..7f11d712 100644 --- a/src/common/backend/utils/init/globals.cpp +++ b/src/common/backend/utils/init/globals.cpp @@ -59,7 +59,7 @@ bool open_join_children = true; bool will_shutdown = false; /* hard-wired binary version number */ -const uint32 GRAND_VERSION_NUM = 92307; +const uint32 GRAND_VERSION_NUM = 92308; const uint32 MATVIEW_VERSION_NUM = 92213; const uint32 PARTIALPUSH_VERSION_NUM = 92087; diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index 3a66d856..1a11e3af 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -166,6 +166,7 @@ DATA(insert ( 2127 timestamptz_larger timestamptz_larger - 1324 1184 _null_ _nu DATA(insert ( 2128 interval_larger interval_larger - 1334 1186 _null_ _null_ n 0)); DATA(insert ( 2129 text_larger text_larger - 666 25 _null_ _null_ n 0)); DATA(insert ( 2130 numeric_larger numeric_larger - 1756 1700 _null_ _null_ n 0)); +DATA(insert ( 6668 network_larger network_larger - 1205 869 _null_ _null_ n 0)); #define NUMERICLARGERFUNCOID 2130 DATA(insert ( 2050 array_larger array_larger - 1073 2277 _null_ _null_ n 0)); DATA(insert ( 2244 bpchar_larger bpchar_larger - 1060 1042 _null_ _null_ n 0)); @@ -196,6 +197,7 @@ DATA(insert ( 2143 timestamptz_smaller timestamptz_smaller - 1322 1184 _null_ _ DATA(insert ( 2144 interval_smaller interval_smaller - 1332 1186 _null_ _null_ n 0)); DATA(insert ( 2145 text_smaller text_smaller - 664 25 _null_ _null_ n 0)); DATA(insert ( 2146 numeric_smaller numeric_smaller - 1754 1700 _null_ _null_ n 0)); +DATA(insert ( 6669 network_smaller network_smaller - 1203 869 _null_ _null_ n 0)); #define NUMERICSMALLERFUNCOID 2146 DATA(insert ( 2051 array_smaller array_smaller - 1072 2277 _null_ _null_ n 0)); DATA(insert ( 2245 bpchar_smaller bpchar_smaller - 1058 1042 _null_ _null_ n 0)); diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_304.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_304.sql index ca1296db..c6f256bd 100644 --- a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_304.sql +++ b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_304.sql @@ -4,3 +4,4 @@ DROP AGGREGATE IF EXISTS pg_catalog.last(anyelement) CASCADE; DROP AGGREGATE IF EXISTS pg_catalog.first(anyelement) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.last_transition(anyelement, anyelement) CASCADE; DROP FUNCTION IF EXISTS pg_catalog.first_transition(anyelement, anyelement) CASCADE; + diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_308.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_308.sql new file mode 100644 index 00000000..9ae2d1cb --- /dev/null +++ b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_308.sql @@ -0,0 +1,4 @@ +DROP AGGREGATE IF EXISTS pg_catalog.max(inet) CASCADE; +DROP AGGREGATE IF EXISTS pg_catalog.min(inet) CASCADE; +DROP FUNCTION IF EXISTS pg_catalog.network_larger(inet, inet) CASCADE; +DROP FUNCTION IF EXISTS pg_catalog.network_smaller(inet, inet) CASCADE; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_308.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_308.sql new file mode 100644 index 00000000..9ae2d1cb --- /dev/null +++ b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_308.sql @@ -0,0 +1,4 @@ +DROP AGGREGATE IF EXISTS pg_catalog.max(inet) CASCADE; +DROP AGGREGATE IF EXISTS pg_catalog.min(inet) CASCADE; +DROP FUNCTION IF EXISTS pg_catalog.network_larger(inet, inet) CASCADE; +DROP FUNCTION IF EXISTS pg_catalog.network_smaller(inet, inet) CASCADE; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_304.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_304.sql index 30ffbb95..778f0921 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_304.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_304.sql @@ -35,4 +35,4 @@ SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6561; create aggregate last(anyelement) ( sfunc = last_transition, stype = anyelement -); +); \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_308.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_308.sql new file mode 100644 index 00000000..69d3517e --- /dev/null +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_308.sql @@ -0,0 +1,25 @@ +DROP FUNCTION IF EXISTS pg_catalog.network_larger(inet, inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6666; +CREATE FUNCTION pg_catalog.network_larger ( +inet, inet +) RETURNS inet LANGUAGE INTERNAL STRICT as 'network_larger'; + +DROP FUNCTION IF EXISTS pg_catalog.network_smaller(inet, inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6667; +CREATE FUNCTION pg_catalog.network_smaller ( +inet, inet +) RETURNS inet LANGUAGE INTERNAL STRICT as 'network_smaller'; + +DROP aggregate IF EXISTS pg_catalog.max(inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6668; +create aggregate max(inet) ( + sfunc = network_larger, + stype = inet +); + +DROP aggregate IF EXISTS pg_catalog.min(inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6669; +create aggregate min(inet) ( + sfunc = network_smaller, + stype = inet +); \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_304.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_304.sql index 30ffbb95..778f0921 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_304.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_304.sql @@ -35,4 +35,4 @@ SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6561; create aggregate last(anyelement) ( sfunc = last_transition, stype = anyelement -); +); \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_308.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_308.sql new file mode 100644 index 00000000..69d3517e --- /dev/null +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_308.sql @@ -0,0 +1,25 @@ +DROP FUNCTION IF EXISTS pg_catalog.network_larger(inet, inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6666; +CREATE FUNCTION pg_catalog.network_larger ( +inet, inet +) RETURNS inet LANGUAGE INTERNAL STRICT as 'network_larger'; + +DROP FUNCTION IF EXISTS pg_catalog.network_smaller(inet, inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6667; +CREATE FUNCTION pg_catalog.network_smaller ( +inet, inet +) RETURNS inet LANGUAGE INTERNAL STRICT as 'network_smaller'; + +DROP aggregate IF EXISTS pg_catalog.max(inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6668; +create aggregate max(inet) ( + sfunc = network_larger, + stype = inet +); + +DROP aggregate IF EXISTS pg_catalog.min(inet) CASCADE; +SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 6669; +create aggregate min(inet) ( + sfunc = network_smaller, + stype = inet +); \ No newline at end of file diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 011f5b74..c2937ae3 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -1097,6 +1097,8 @@ extern Datum network_eq(PG_FUNCTION_ARGS); extern Datum network_ge(PG_FUNCTION_ARGS); extern Datum network_gt(PG_FUNCTION_ARGS); extern Datum network_ne(PG_FUNCTION_ARGS); +extern Datum network_smaller(PG_FUNCTION_ARGS); +extern Datum network_larger(PG_FUNCTION_ARGS); extern Datum hashinet(PG_FUNCTION_ARGS); extern Datum network_sub(PG_FUNCTION_ARGS); extern Datum network_subeq(PG_FUNCTION_ARGS); diff --git a/src/test/regress/expected/min_max_support_IP.out b/src/test/regress/expected/min_max_support_IP.out new file mode 100644 index 00000000..35b7c429 --- /dev/null +++ b/src/test/regress/expected/min_max_support_IP.out @@ -0,0 +1,240 @@ +--To test that the min and max functions support IP address type parameters +--Test whether the function is normal when inet type data is input: support, and the result is in line with expectations +--Create a table space +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr inet,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values('192.168.1.0','taishan00'); +insert into row_tab01 values('192.168.1.1','taishan01'); +insert into row_tab01 values('192.168.1.2','taishan02'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +------------- + 192.168.1.0 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +------------- + 192.168.1.2 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--Create a column table space +drop tablespace if exists column_tabspace01; +NOTICE: Tablespace "column_tabspace01" does not exist, skipping. +create tablespace column_tabspace01 relative location 'tablespace/column_space01'; +--Create table +drop table if exists column_tab01; +NOTICE: table "column_tab01" does not exist, skipping +create table column_tab01(ip_addr inet,ip_name char(9)) with(orientation=column); +--Insert data +insert into column_tab01 values('192.168.1.0','taishan00'); +insert into column_tab01 values('192.168.1.1','taishan01'); +insert into column_tab01 values('192.168.1.2','taishan02'); +--function test +select min(ip_addr) as min_ip_addr from column_tab01; + min_ip_addr +------------- + 192.168.1.0 +(1 row) + +select max(ip_addr) as max_ip_addr from column_tab01; + max_ip_addr +------------- + 192.168.1.2 +(1 row) + +--Delete table +drop table column_tab01 cascade; +drop tablespace column_tabspace01; +--Test whether the function is normal when cidr type data is input: support, and the result is in line with expectations +---When the mask is all 1, the IP address is unique, and the comparison result does not display the mask +--IPV4 test +--Test mask comparison function +--Create a table space +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('192.168.1.8/32','taishan00'); +insert into row_tab01 values ('192.168.1.8/31','taishan00'); +insert into row_tab01 values ('192.168.1.8/30','taishan00'); +insert into row_tab01 values ('192.168.1.8/29','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +---------------- + 192.168.1.8/29 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +------------- + 192.168.1.8 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--IPV4 test +--Test the IP address comparison function +--Create a table space +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('10.1.2.8/29','taishan00'); +insert into row_tab01 values ('10.1.2.16/29','taishan00'); +insert into row_tab01 values ('10.1.2.32/29','taishan00'); +insert into row_tab01 values ('10.1.2.48/29','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +------------- + 10.1.2.8/29 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +-------------- + 10.1.2.48/29 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--IPV6 test +--Test mask comparison function +--Create a table space +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/128','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +-------------------------------------- + 2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +---------------------------------- + 2001:4f8:3:ba:2e0:81ff:fe22:d1f0 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--IPV6 test +--Test the IP address comparison function +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1e0/127','taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +-------------------------------------- + 2001:4f8:3:ba:2e0:81ff:fe22:d1e0/127 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +-------------------------------------- + 2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--when insert IP address type different +--Create a table space +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('10.1.2.48/29','taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +-------------- + 10.1.2.48/29 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +-------------------------------------- + 2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--when insert IP address type different +--Create a table space +drop tablespace if exists row_tabspace01; +NOTICE: Tablespace "row_tabspace01" does not exist, skipping. +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +NOTICE: table "row_tab01" does not exist, skipping +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('taishan00'); +ERROR: invalid input syntax for type cidr: "taishan00" +LINE 1: insert into row_tab01 values ('taishan00'); + ^ +CONTEXT: referenced column: ip_addr +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +insert into row_tab01 values ('0','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; + min_ip_addr +------------- + 0.0.0.0/8 +(1 row) + +select max(ip_addr) as max_ip_addr from row_tab01; + max_ip_addr +-------------------------------------- + 2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127 +(1 row) + +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; diff --git a/src/test/regress/expected/single_node_opr_sanity.out b/src/test/regress/expected/single_node_opr_sanity.out index ab5e1198..af9a31ac 100644 --- a/src/test/regress/expected/single_node_opr_sanity.out +++ b/src/test/regress/expected/single_node_opr_sanity.out @@ -2837,6 +2837,10 @@ WHERE d.classoid IS NULL AND p1.oid <= 9999 order by 1; 6559 | last_transition 6560 | first 6561 | last + 6666 | network_larger + 6667 | network_smaller + 6668 | max + 6669 | min 7101 | db4ai_predict_by_bool 7102 | db4ai_predict_by_int32 7103 | db4ai_predict_by_int64 diff --git a/src/test/regress/parallel_schedule0 b/src/test/regress/parallel_schedule0 index 4ec48186..59d6fcdb 100644 --- a/src/test/regress/parallel_schedule0 +++ b/src/test/regress/parallel_schedule0 @@ -176,6 +176,10 @@ test: single_node_produce_commit_rollback test: instr_unique_sql test: shutdown +# To check min_max fuc support IP +test: min_max_support_IP + + # interval partition test: hw_partition_interval test: hw_partition_interval_exchange diff --git a/src/test/regress/sql/min_max_support_IP.sql b/src/test/regress/sql/min_max_support_IP.sql new file mode 100644 index 00000000..e7ca29a9 --- /dev/null +++ b/src/test/regress/sql/min_max_support_IP.sql @@ -0,0 +1,144 @@ +--To test that the min and max functions support IP address type parameters + +--Test whether the function is normal when inet type data is input: support, and the result is in line with expectations +--Create a table space +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr inet,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values('192.168.1.0','taishan00'); +insert into row_tab01 values('192.168.1.1','taishan01'); +insert into row_tab01 values('192.168.1.2','taishan02'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; + +--Create a column table space +drop tablespace if exists column_tabspace01; +create tablespace column_tabspace01 relative location 'tablespace/column_space01'; +--Create table +drop table if exists column_tab01; +create table column_tab01(ip_addr inet,ip_name char(9)) with(orientation=column); +--Insert data +insert into column_tab01 values('192.168.1.0','taishan00'); +insert into column_tab01 values('192.168.1.1','taishan01'); +insert into column_tab01 values('192.168.1.2','taishan02'); +--function test +select min(ip_addr) as min_ip_addr from column_tab01; +select max(ip_addr) as max_ip_addr from column_tab01; +--Delete table +drop table column_tab01 cascade; +drop tablespace column_tabspace01; + +--Test whether the function is normal when cidr type data is input: support, and the result is in line with expectations +---When the mask is all 1, the IP address is unique, and the comparison result does not display the mask +--IPV4 test +--Test mask comparison function +--Create a table space +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('192.168.1.8/32','taishan00'); +insert into row_tab01 values ('192.168.1.8/31','taishan00'); +insert into row_tab01 values ('192.168.1.8/30','taishan00'); +insert into row_tab01 values ('192.168.1.8/29','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--IPV4 test +--Test the IP address comparison function +--Create a table space +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('10.1.2.8/29','taishan00'); +insert into row_tab01 values ('10.1.2.16/29','taishan00'); +insert into row_tab01 values ('10.1.2.32/29','taishan00'); +insert into row_tab01 values ('10.1.2.48/29','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--IPV6 test +--Test mask comparison function +--Create a table space +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/128','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--IPV6 test +--Test the IP address comparison function +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1e0/127','taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--when insert IP address type different +--Create a table space +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('10.1.2.48/29','taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +--when insert IP address type different +--Create a table space +drop tablespace if exists row_tabspace01; +create tablespace row_tabspace01 relative location 'tablespace/row_space01'; +--Create table +drop table if exists row_tab01; +create table row_tab01(ip_addr cidr,ip_name char(9)) with(orientation=row); +--Insert data +insert into row_tab01 values ('taishan00'); +insert into row_tab01 values ('2001:4f8:3:ba:2e0:81ff:fe22:d1f0/127','taishan00'); +insert into row_tab01 values ('0','taishan00'); +--function test +select min(ip_addr) as min_ip_addr from row_tab01; +select max(ip_addr) as max_ip_addr from row_tab01; +--Delete table +drop table row_tab01 cascade; +drop tablespace row_tabspace01; +