提交 403f881b 编写于 作者: M Monk-Liu 提交者: LINGuanRen

[mysql][window function]: fix 4 order by bugs in ob-mysql window function.

上级 5e0b6e4c
......@@ -165,6 +165,29 @@ constexpr int OB_ERR_WRONG_VALUE = -5241;
constexpr int OB_ERR_UNEXPECTED_TZ_TRANSITION = -5297;
constexpr int OB_ERR_INVALID_TIMEZONE_REGION_ID = -5341;
constexpr int OB_ERR_INVALID_HEX_NUMBER = -5342;
constexpr int OB_ERR_INVALID_JSON_TEXT = -5411;
constexpr int OB_ERR_INVALID_JSON_TEXT_IN_PARAM = -5412;
constexpr int OB_ERR_INVALID_JSON_BINARY_DATA = -5413;
constexpr int OB_ERR_INVALID_JSON_PATH = -5414;
constexpr int OB_ERR_INVALID_JSON_CHARSET = -5415;
constexpr int OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION = -5416;
constexpr int OB_ERR_INVALID_TYPE_FOR_JSON = -5417;
constexpr int OB_ERR_INVALID_CAST_TO_JSON = -5418;
constexpr int OB_ERR_INVALID_JSON_PATH_CHARSET = -5419;
constexpr int OB_ERR_INVALID_JSON_PATH_WILDCARD = -5420;
constexpr int OB_ERR_JSON_VALUE_TOO_BIG = -5421;
constexpr int OB_ERR_JSON_KEY_TOO_BIG = -5422;
constexpr int OB_ERR_JSON_USED_AS_KEY = -5423;
constexpr int OB_ERR_JSON_VACUOUS_PATH = -5424;
constexpr int OB_ERR_JSON_BAD_ONE_OR_ALL_ARG = -5425;
constexpr int OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE = -5426;
constexpr int OB_ERR_INVALID_JSON_VALUE_FOR_CAST = -5427;
constexpr int OB_ERR_JSON_OUT_OF_DEPTH = -5428;
constexpr int OB_ERR_JSON_DOCUMENT_NULL_KEY = -5429;
constexpr int OB_ERR_BLOB_CANT_HAVE_DEFAULT = -5430;
constexpr int OB_ERR_INVALID_JSON_PATH_ARRAY_CELL = -5431;
constexpr int OB_ERR_MISSING_JSON_VALUE = -5432;
constexpr int OB_ERR_MULTIPLE_JSON_VALUES = -5433;
constexpr int OB_ERR_YEAR_CONFLICTS_WITH_JULIAN_DATE = -5629;
constexpr int OB_ERR_DAY_OF_YEAR_CONFLICTS_WITH_JULIAN_DATE = -5630;
constexpr int OB_ERR_MONTH_CONFLICTS_WITH_JULIAN_DATE = -5631;
......@@ -214,29 +237,6 @@ constexpr int OB_INVALID_ROWID = -5802;
constexpr int OB_ERR_NUMERIC_NOT_MATCH_FORMAT_LENGTH = -5873;
constexpr int OB_ERR_DATETIME_INTERVAL_INTERNAL_ERROR = -5898;
constexpr int OB_ERR_ILL_OBJ_FLAG = -5974;
constexpr int OB_ERR_INVALID_JSON_TEXT = -5975;
constexpr int OB_ERR_INVALID_JSON_TEXT_IN_PARAM = -5976;
constexpr int OB_ERR_INVALID_JSON_BINARY_DATA = -5977;
constexpr int OB_ERR_INVALID_JSON_PATH = -5978;
constexpr int OB_ERR_INVALID_JSON_CHARSET = -5979;
constexpr int OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION = -5980;
constexpr int OB_ERR_INVALID_TYPE_FOR_JSON = -5981;
constexpr int OB_ERR_INVALID_CAST_TO_JSON = -5982;
constexpr int OB_ERR_INVALID_JSON_PATH_CHARSET = -5983;
constexpr int OB_ERR_INVALID_JSON_PATH_WILDCARD = -5984;
constexpr int OB_ERR_JSON_VALUE_TOO_BIG = -5985;
constexpr int OB_ERR_JSON_KEY_TOO_BIG = -5986;
constexpr int OB_ERR_JSON_USED_AS_KEY = -5987;
constexpr int OB_ERR_JSON_VACUOUS_PATH = -5988;
constexpr int OB_ERR_JSON_BAD_ONE_OR_ALL_ARG = -5989;
constexpr int OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE = -5990;
constexpr int OB_ERR_INVALID_JSON_VALUE_FOR_CAST = -5991;
constexpr int OB_ERR_JSON_OUT_OF_DEPTH = -5992;
constexpr int OB_ERR_JSON_DOCUMENT_NULL_KEY = -5993;
constexpr int OB_ERR_BLOB_CANT_HAVE_DEFAULT = -5994;
constexpr int OB_ERR_INVALID_JSON_PATH_ARRAY_CELL = -5995;
constexpr int OB_ERR_MISSING_JSON_VALUE = -5996;
constexpr int OB_ERR_MULTIPLE_JSON_VALUES = -5997;
constexpr int OB_MASK_SET_NO_NODE = -6203;
constexpr int OB_TRANS_TIMEOUT = -6210;
constexpr int OB_TRANS_KILLED = -6211;
......
......@@ -46,7 +46,7 @@ while(<$fh>) {
$error_code = $2;
$sqlstate = $4;
$error_msg = $5;
} elsif (/^DEFINE_ERROR_EXT\(([^,]+),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*("[^"]*")/) {
} elsif (/^DEFINE_ERROR_EXT\(([^,]+),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*("[^"]*"),\s*("[^"]*")/) {
++$error_count;
#print "\"$1\", $1, $2, $3, $4, $5, $6, $7, $8\n";
my $tmp_ora_errmsg=sprintf($print_def_ora_errmsg, "ORA", $def_ora_errno, $2, substr($5, 1, length($5) - 2));
......@@ -56,7 +56,7 @@ while(<$fh>) {
$error_code = $2;
$sqlstate = $4;
$error_msg = $5;
} elsif (/^DEFINE_ERROR_EXT\(([^,]+),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*("[^"]*")/) {
} elsif (/^DEFINE_ERROR_EXT\(([^,]+),\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*("[^"]*"),\s*("[^"]*")/) {
++$error_count;
#print "\"$1\", $1, $2, $3, $4, $5, $6\n";
my $tmp_ora_errmsg=sprintf($print_def_ora_errmsg, "ORA", $def_ora_errno, $2, substr($5, 1, length($5) - 2));
......
......@@ -47,6 +47,9 @@
#define ER_TOO_BIG_ENUM 3504
#define ER_TOO_LONG_SET_ENUM_VALUE 3505
#define ER_TOO_MANY_TENANT_PARTITIONS_ERROR 3506
#define ER_WINDOW_RANGE_FRAME_ORDER_TYPE 3587
#define ER_WINDOW_ILLEGAL_ORDER_BY 3592
#define ER_WINDOW_ROWS_INTERVAL_USE 3596
#define ER_MISSING_JSON_VALUE 3966
#define ER_MULTIPLE_JSON_VALUES 3967
......
此差异已折叠。
......@@ -934,6 +934,33 @@ DEFINE_ORACLE_ERROR_EXT(OB_ERR_CANNOT_GRANT_STRING_TO_A_ROLE, -5382, -1, "HY000"
DEFINE_ORACLE_ERROR(OB_ERR_CASCADE_CONSTRAINTS_MUST_BE_SPECIFIED_TO_PERFORM_THIS_REVOKE, -5383, -1, "HY000", "CASCADE CONSTRAINTS must be specified to perform this revoke", 1981, "CASCADE CONSTRAINTS must be specified to perform this revoke");
DEFINE_ORACLE_ERROR(OB_ERR_YOU_MAY_NOT_REVOKE_PRIVILEGES_FROM_YOURSELF, -5384, -1, "HY000", "you may not GRANT/REVOKE privileges to/from yourself", 1749, "you may not GRANT/REVOKE privileges to/from yourself");
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//error code for json -5410 ---- -5433, as for json only support mysql mode, error code for oracle use special values
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_TEXT, -5411, ER_INVALID_JSON_TEXT, "22032", "Invalid JSON text.", "Invalid JSON text.", 600, "Invalid JSON text.", "Invalid JSON text.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_TEXT_IN_PARAM, -5412, ER_INVALID_JSON_TEXT_IN_PARAM, "22032", "Invalid JSON text in argument.", "Invalid JSON text in argument.", 600, "Invalid JSON text in argument.", "Invalid JSON text in argument.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_BINARY_DATA, -5413, ER_INVALID_JSON_BINARY_DATA, "42000", "The JSON binary value contains invalid data.", "The JSON binary value contains invalid data.", 600, "The JSON binary value contains invalid data.", "The JSON binary value contains invalid data.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH, -5414, ER_INVALID_JSON_PATH, "42000", "Invalid JSON path expression.", "Invalid JSON path expression.", 600, "Invalid JSON path expression.", "Invalid JSON path expression.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_CHARSET, -5415, ER_INVALID_JSON_CHARSET, "22032", "Cannot create a JSON value from a string.", "Cannot create a JSON value from a string.", 600, "Cannot create a JSON value from a string.", "Cannot create a JSON value from a string.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION, -5416, ER_INVALID_JSON_CHARSET_IN_FUNCTION, "22032", "Invalid JSON character data provided to function.", "Invalid JSON character data provided to function.", 600, "Invalid JSON character data provided to function.", "Invalid JSON character data provided to function.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_TYPE_FOR_JSON, -5417, ER_INVALID_TYPE_FOR_JSON, "22032", "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.", "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.", 600, "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.", "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_CAST_TO_JSON, -5418, ER_INVALID_CAST_TO_JSON, "22032", "Cannot CAST value to JSON.", "Cannot CAST value to JSON.", 600, "Cannot CAST value to JSON.", "Cannot CAST value to JSON.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH_CHARSET, -5419, ER_INVALID_JSON_PATH_CHARSET, "42000", "A path expression must be encoded in the utf8 character set.", "A path expression must be encoded in the utf8 character set.", 600, "A path expression must be encoded in the utf8 character set.", "A path expression must be encoded in the utf8 character set.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH_WILDCARD, -5420, ER_INVALID_JSON_PATH_WILDCARD, "42000", "In this situation, path expressions may not contain the * and ** tokens.", "In this situation, path expressions may not contain the * and ** tokens.", 600, "In this situation, path expressions may not contain the * and ** tokens.", "In this situation, path expressions may not contain the * and ** tokens.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_VALUE_TOO_BIG, -5421, ER_JSON_VALUE_TOO_BIG, "22032", "The JSON value is too big to be stored in a JSON column.", "The JSON value is too big to be stored in a JSON column.", 600, "The JSON value is too big to be stored in a JSON column.", "The JSON value is too big to be stored in a JSON column.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_KEY_TOO_BIG, -5422, ER_JSON_KEY_TOO_BIG, "22032", "The JSON object contains a key name that is too long.", "The JSON object contains a key name that is too long.", 600, "The JSON object contains a key name that is too long.", "The JSON object contains a key name that is too long.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_USED_AS_KEY, -5423, ER_JSON_USED_AS_KEY, "42000", "JSON column cannot be used in key specification.", "JSON column '%.*s' cannot be used in key specification.", 600, "JSON column cannot be used in key specification.", "JSON column '%.*s' cannot be used in key specification.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_VACUOUS_PATH, -5424, ER_JSON_VACUOUS_PATH, "42000", "The path expression is not allowed in this context.", "The path expression is not allowed in this context.", 600, "The path expression is not allowed in this context.", "The path expression is not allowed in this context.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_BAD_ONE_OR_ALL_ARG, -5425, ER_JSON_BAD_ONE_OR_ALL_ARG, "42000", "The oneOrAll argument may take these values: \'one\' or \'all\'.", "The oneOrAll argument may take these values: \'one\' or \'all\'.", 600, "The oneOrAll argument may take these values: \'one\' or \'all\'.", "The oneOrAll argument may take these values: \'one\' or \'all\'.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE, -5426, ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE, "22003", "Out of range JSON value for CAST", "Out of range JSON value for CAST", 600, "Out of range JSON value for CAST", "Out of range JSON value for CAST");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_VALUE_FOR_CAST, -5427, ER_INVALID_JSON_VALUE_FOR_CAST, "22018", "Invalid JSON value for CAST", "Invalid JSON value for CAST", 600, "Invalid JSON value for CAST", "Invalid JSON value for CAST");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_OUT_OF_DEPTH, -5428, ER_JSON_DOCUMENT_TOO_DEEP, "22032", "The JSON document exceeds the maximum depth.", "The JSON document exceeds the maximum depth.", 600, "The JSON document exceeds the maximum depth.", "The JSON document exceeds the maximum depth.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_DOCUMENT_NULL_KEY, -5429, ER_JSON_DOCUMENT_NULL_KEY, "22032", "JSON documents may not contain NULL member names.", "JSON documents may not contain NULL member names.", 600, "JSON documents may not contain NULL member names.", "JSON documents may not contain NULL member names.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_BLOB_CANT_HAVE_DEFAULT, -5430, ER_BLOB_CANT_HAVE_DEFAULT, "42000", "BLOB, TEXT, GEOMETRY or JSON column can't have a default value", "BLOB, TEXT, GEOMETRY or JSON column '%.*s' can't have a default value", 600, "Invalid default value", "Invalid default value for \'%.*s\'");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH_ARRAY_CELL, -5431, ER_INVALID_JSON_PATH_ARRAY_CELL, "42000", "A path expression is not a path to a cell in an array", "A path expression is not a path to a cell in an array", 600, "A path expression is not a path to a cell in an array", "A path expression is not a path to a cell in an array");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_MISSING_JSON_VALUE, -5432, ER_MISSING_JSON_VALUE, "22035", "No value was found by '%.*s' on the specified path.", "No value was found by '%.192s' on the specified path.", 600, "No value was found by '%.192s' on the specified path.", "No value was found by '%.192s' on the specified path.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_MULTIPLE_JSON_VALUES, -5433, ER_MULTIPLE_JSON_VALUES, "22034", "More than one value was found by '%.*s' on the specified path.", "More than one value was found by '%.192s' on the specified path.", 600, "More than one value was found by '%.192s' on the specified path.", "More than one value was found by '%.192s' on the specified path.");
DEFINE_ERROR_EXT(OB_ERR_SP_ALREADY_EXISTS, -5541, ER_SP_ALREADY_EXISTS, "42000", "procedure/function already exists", "%s %.*s already exists");
DEFINE_ERROR_EXT(OB_ERR_SP_DOES_NOT_EXIST, -5542, ER_SP_DOES_NOT_EXIST, "42000", "procedure/function does not exist", "%s %.*s.%.*s does not exist");
DEFINE_PLS_ERROR_EXT(OB_ERR_SP_UNDECLARED_VAR, -5543, ER_SP_UNDECLARED_VAR, "42000", "Undeclared variable", "Undeclared variable: %.*s", 201, "identifier must be declared", "identifier '%.*s' must be declared");
......@@ -1329,34 +1356,9 @@ DEFINE_ERROR_EXT(OB_ERR_CTE_NEED_QUERY_BLOCKS, -5976, 3574, "HY000", "Recursive
DEFINE_ERROR_EXT(OB_ERR_INCORRECT_VALUE_FOR_FUNCTION, -5936, ER_WRONG_VALUE_FOR_TYPE, "HY000", "Incorrect value for function", "Incorrect %.*s value: '%.*s' for function %.*s");
DEFINE_ERROR_EXT(OB_ERR_USER_EXCEED_RESOURCE, -5967, 1226, "42000", "User has exceeded the resource", "User '%.*s' has exceeded the '%s' resource (current value: %lu)");
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//error code for json -5977 ---- -5997, as for json only support mysql mode, error code for oracle use special values
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_TEXT, -5975, ER_INVALID_JSON_TEXT, "22032", "Invalid JSON text.", "Invalid JSON text.", 600, "Invalid JSON text.", "Invalid JSON text.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_TEXT_IN_PARAM, -5974, ER_INVALID_JSON_TEXT_IN_PARAM, "22032", "Invalid JSON text in argument.", "Invalid JSON text in argument.", 600, "Invalid JSON text in argument.", "Invalid JSON text in argument.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_BINARY_DATA, -5977, ER_INVALID_JSON_BINARY_DATA, "42000", "The JSON binary value contains invalid data.", "The JSON binary value contains invalid data.", 600, "The JSON binary value contains invalid data.", "The JSON binary value contains invalid data.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH, -5978, ER_INVALID_JSON_PATH, "42000", "Invalid JSON path expression.", "Invalid JSON path expression.", 600, "Invalid JSON path expression.", "Invalid JSON path expression.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_CHARSET, -5979, ER_INVALID_JSON_CHARSET, "22032", "Cannot create a JSON value from a string.", "Cannot create a JSON value from a string.", 600, "Cannot create a JSON value from a string.", "Cannot create a JSON value from a string.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION, -5980, ER_INVALID_JSON_CHARSET_IN_FUNCTION, "22032", "Invalid JSON character data provided to function.", "Invalid JSON character data provided to function.", 600, "Invalid JSON character data provided to function.", "Invalid JSON character data provided to function.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_TYPE_FOR_JSON, -5981, ER_INVALID_TYPE_FOR_JSON, "22032", "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.", "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.", 600, "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.", "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_CAST_TO_JSON, -5982, ER_INVALID_CAST_TO_JSON, "22032", "Cannot CAST value to JSON.", "Cannot CAST value to JSON.", 600, "Cannot CAST value to JSON.", "Cannot CAST value to JSON.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH_CHARSET, -5983, ER_INVALID_JSON_PATH_CHARSET, "42000", "A path expression must be encoded in the utf8 character set.", "A path expression must be encoded in the utf8 character set.", 600, "A path expression must be encoded in the utf8 character set.", "A path expression must be encoded in the utf8 character set.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH_WILDCARD, -5984, ER_INVALID_JSON_PATH_WILDCARD, "42000", "In this situation, path expressions may not contain the * and ** tokens.", "In this situation, path expressions may not contain the * and ** tokens.", 600, "In this situation, path expressions may not contain the * and ** tokens.", "In this situation, path expressions may not contain the * and ** tokens.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_VALUE_TOO_BIG, -5985, ER_JSON_VALUE_TOO_BIG, "22032", "The JSON value is too big to be stored in a JSON column.", "The JSON value is too big to be stored in a JSON column.", 600, "The JSON value is too big to be stored in a JSON column.", "The JSON value is too big to be stored in a JSON column.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_KEY_TOO_BIG, -5986, ER_JSON_KEY_TOO_BIG, "22032", "The JSON object contains a key name that is too long.", "The JSON object contains a key name that is too long.", 600, "The JSON object contains a key name that is too long.", "The JSON object contains a key name that is too long.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_USED_AS_KEY, -5987, ER_JSON_USED_AS_KEY, "42000", "JSON column cannot be used in key specification.", "JSON column '%.*s' cannot be used in key specification.", 600, "JSON column cannot be used in key specification.", "JSON column '%.*s' cannot be used in key specification.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_VACUOUS_PATH, -5988, ER_JSON_VACUOUS_PATH, "42000", "The path expression is not allowed in this context.", "The path expression is not allowed in this context.", 600, "The path expression is not allowed in this context.", "The path expression is not allowed in this context.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_BAD_ONE_OR_ALL_ARG, -5989, ER_JSON_BAD_ONE_OR_ALL_ARG, "42000", "The oneOrAll argument may take these values: \'one\' or \'all\'.", "The oneOrAll argument may take these values: \'one\' or \'all\'.", 600, "The oneOrAll argument may take these values: \'one\' or \'all\'.", "The oneOrAll argument may take these values: \'one\' or \'all\'.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE, -5990, ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE, "22003", "Out of range JSON value for CAST", "Out of range JSON value for CAST", 600, "Out of range JSON value for CAST", "Out of range JSON value for CAST");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_VALUE_FOR_CAST, -5991, ER_INVALID_JSON_VALUE_FOR_CAST, "22018", "Invalid JSON value for CAST", "Invalid JSON value for CAST", 600, "Invalid JSON value for CAST", "Invalid JSON value for CAST");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_OUT_OF_DEPTH, -5992, ER_JSON_DOCUMENT_TOO_DEEP, "22032", "The JSON document exceeds the maximum depth.", "The JSON document exceeds the maximum depth.", 600, "The JSON document exceeds the maximum depth.", "The JSON document exceeds the maximum depth.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_JSON_DOCUMENT_NULL_KEY, -5993, ER_JSON_DOCUMENT_NULL_KEY, "22032", "JSON documents may not contain NULL member names.", "JSON documents may not contain NULL member names.", 600, "JSON documents may not contain NULL member names.", "JSON documents may not contain NULL member names.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_BLOB_CANT_HAVE_DEFAULT, -5994, ER_BLOB_CANT_HAVE_DEFAULT, "42000", "BLOB, TEXT, GEOMETRY or JSON column can't have a default value", "BLOB, TEXT, GEOMETRY or JSON column '%.*s' can't have a default value", 600, "Invalid default value", "Invalid default value for \'%.*s\'");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_INVALID_JSON_PATH_ARRAY_CELL, -5995, ER_INVALID_JSON_PATH_ARRAY_CELL, "42000", "A path expression is not a path to a cell in an array", "A path expression is not a path to a cell in an array", 600, "A path expression is not a path to a cell in an array", "A path expression is not a path to a cell in an array");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_MISSING_JSON_VALUE, -5996, ER_MISSING_JSON_VALUE, "22035", "No value was found by '%.*s' on the specified path.", "No value was found by '%.192s' on the specified path.", 600, "No value was found by '%.192s' on the specified path.", "No value was found by '%.192s' on the specified path.");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_MULTIPLE_JSON_VALUES, -5997, ER_MULTIPLE_JSON_VALUES, "22034", "More than one value was found by '%.*s' on the specified path.", "More than one value was found by '%.192s' on the specified path.", 600, "More than one value was found by '%.192s' on the specified path.", "More than one value was found by '%.192s' on the specified path.");
DEFINE_ERROR_EXT(OB_ERR_WINDOW_ROWS_INTERVAL_USE, -5983, ER_WINDOW_ROWS_INTERVAL_USE, "HY000", "Window '<unnamed window>': INTERVAL can only be used with RANGE frames.", "Window '%s': INTERVAL can only be used with RANGE frames.");
DEFINE_ERROR_EXT(OB_ERR_WINDOW_RANGE_FRAME_ORDER_TYPE, -5984, ER_WINDOW_RANGE_FRAME_ORDER_TYPE, "HY000", "Window '<unnamed window>' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression of numeric or temporal type", "Window '%s' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression of numeric or temporal type");
DEFINE_ERROR_EXT(OB_ERR_WINDOW_ILLEGAL_ORDER_BY, -5985, ER_WINDOW_ILLEGAL_ORDER_BY, "HY000", "Window '<unnamed window>': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression.", "Window '%s': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression.");
////////////////////////////////////////////////////////////////
//error code for transaction, mvcc and commitlog -6001 ---- -7000
////////////////////////////////////////////////////////////////
......
......@@ -1036,6 +1036,9 @@ constexpr int OB_ERR_ILL_NAME_STRING = -5932;
constexpr int OB_ERR_INCORRECT_VALUE_FOR_FUNCTION = -5936;
constexpr int OB_ERR_USER_EXCEED_RESOURCE = -5967;
constexpr int OB_ERR_CTE_NEED_QUERY_BLOCKS = -5976;
constexpr int OB_ERR_WINDOW_ROWS_INTERVAL_USE = -5983;
constexpr int OB_ERR_WINDOW_RANGE_FRAME_ORDER_TYPE = -5984;
constexpr int OB_ERR_WINDOW_ILLEGAL_ORDER_BY = -5985;
constexpr int OB_TRANSACTION_SET_VIOLATION = -6001;
constexpr int OB_TRANS_ROLLBACKED = -6002;
constexpr int OB_ERR_EXCLUSIVE_LOCK_CONFLICT = -6003;
......@@ -2067,6 +2070,29 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_CANNOT_GRANT_STRING_TO_A_ROLE__USER_ERROR_MSG "cannot grant %.*s to a role"
#define OB_ERR_CASCADE_CONSTRAINTS_MUST_BE_SPECIFIED_TO_PERFORM_THIS_REVOKE__USER_ERROR_MSG "CASCADE CONSTRAINTS must be specified to perform this revoke"
#define OB_ERR_YOU_MAY_NOT_REVOKE_PRIVILEGES_FROM_YOURSELF__USER_ERROR_MSG "you may not GRANT/REVOKE privileges to/from yourself"
#define OB_ERR_INVALID_JSON_TEXT__USER_ERROR_MSG "Invalid JSON text."
#define OB_ERR_INVALID_JSON_TEXT_IN_PARAM__USER_ERROR_MSG "Invalid JSON text in argument."
#define OB_ERR_INVALID_JSON_BINARY_DATA__USER_ERROR_MSG "The JSON binary value contains invalid data."
#define OB_ERR_INVALID_JSON_PATH__USER_ERROR_MSG "Invalid JSON path expression."
#define OB_ERR_INVALID_JSON_CHARSET__USER_ERROR_MSG "Cannot create a JSON value from a string."
#define OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION__USER_ERROR_MSG "Invalid JSON character data provided to function."
#define OB_ERR_INVALID_TYPE_FOR_JSON__USER_ERROR_MSG "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required."
#define OB_ERR_INVALID_CAST_TO_JSON__USER_ERROR_MSG "Cannot CAST value to JSON."
#define OB_ERR_INVALID_JSON_PATH_CHARSET__USER_ERROR_MSG "A path expression must be encoded in the utf8 character set."
#define OB_ERR_INVALID_JSON_PATH_WILDCARD__USER_ERROR_MSG "In this situation, path expressions may not contain the * and ** tokens."
#define OB_ERR_JSON_VALUE_TOO_BIG__USER_ERROR_MSG "The JSON value is too big to be stored in a JSON column."
#define OB_ERR_JSON_KEY_TOO_BIG__USER_ERROR_MSG "The JSON object contains a key name that is too long."
#define OB_ERR_JSON_USED_AS_KEY__USER_ERROR_MSG "JSON column '%.*s' cannot be used in key specification."
#define OB_ERR_JSON_VACUOUS_PATH__USER_ERROR_MSG "The path expression is not allowed in this context."
#define OB_ERR_JSON_BAD_ONE_OR_ALL_ARG__USER_ERROR_MSG "The oneOrAll argument may take these values: \'one\' or \'all\'."
#define OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE__USER_ERROR_MSG "Out of range JSON value for CAST"
#define OB_ERR_INVALID_JSON_VALUE_FOR_CAST__USER_ERROR_MSG "Invalid JSON value for CAST"
#define OB_ERR_JSON_OUT_OF_DEPTH__USER_ERROR_MSG "The JSON document exceeds the maximum depth."
#define OB_ERR_JSON_DOCUMENT_NULL_KEY__USER_ERROR_MSG "JSON documents may not contain NULL member names."
#define OB_ERR_BLOB_CANT_HAVE_DEFAULT__USER_ERROR_MSG "BLOB, TEXT, GEOMETRY or JSON column '%.*s' can't have a default value"
#define OB_ERR_INVALID_JSON_PATH_ARRAY_CELL__USER_ERROR_MSG "A path expression is not a path to a cell in an array"
#define OB_ERR_MISSING_JSON_VALUE__USER_ERROR_MSG "No value was found by '%.192s' on the specified path."
#define OB_ERR_MULTIPLE_JSON_VALUES__USER_ERROR_MSG "More than one value was found by '%.192s' on the specified path."
#define OB_ERR_SP_ALREADY_EXISTS__USER_ERROR_MSG "%s %.*s already exists"
#define OB_ERR_SP_DOES_NOT_EXIST__USER_ERROR_MSG "%s %.*s.%.*s does not exist"
#define OB_ERR_SP_UNDECLARED_VAR__USER_ERROR_MSG "Undeclared variable: %.*s"
......@@ -2448,29 +2474,9 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_INCORRECT_VALUE_FOR_FUNCTION__USER_ERROR_MSG "Incorrect %.*s value: '%.*s' for function %.*s"
#define OB_ERR_USER_EXCEED_RESOURCE__USER_ERROR_MSG "User '%.*s' has exceeded the '%s' resource (current value: %lu)"
#define OB_ERR_CTE_NEED_QUERY_BLOCKS__USER_ERROR_MSG "Recursive Common Table Expression should have one or more non-recursive query blocks followed by one or more recursive ones: %s"
#define OB_ERR_INVALID_JSON_TEXT__USER_ERROR_MSG "Invalid JSON text."
#define OB_ERR_INVALID_JSON_TEXT_IN_PARAM__USER_ERROR_MSG "Invalid JSON text in argument."
#define OB_ERR_INVALID_JSON_BINARY_DATA__USER_ERROR_MSG "The JSON binary value contains invalid data."
#define OB_ERR_INVALID_JSON_PATH__USER_ERROR_MSG "Invalid JSON path expression."
#define OB_ERR_INVALID_JSON_CHARSET__USER_ERROR_MSG "Cannot create a JSON value from a string."
#define OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION__USER_ERROR_MSG "Invalid JSON character data provided to function."
#define OB_ERR_INVALID_TYPE_FOR_JSON__USER_ERROR_MSG "Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required."
#define OB_ERR_INVALID_CAST_TO_JSON__USER_ERROR_MSG "Cannot CAST value to JSON."
#define OB_ERR_INVALID_JSON_PATH_CHARSET__USER_ERROR_MSG "A path expression must be encoded in the utf8 character set."
#define OB_ERR_INVALID_JSON_PATH_WILDCARD__USER_ERROR_MSG "In this situation, path expressions may not contain the * and ** tokens."
#define OB_ERR_JSON_VALUE_TOO_BIG__USER_ERROR_MSG "The JSON value is too big to be stored in a JSON column."
#define OB_ERR_JSON_KEY_TOO_BIG__USER_ERROR_MSG "The JSON object contains a key name that is too long."
#define OB_ERR_JSON_USED_AS_KEY__USER_ERROR_MSG "JSON column '%.*s' cannot be used in key specification."
#define OB_ERR_JSON_VACUOUS_PATH__USER_ERROR_MSG "The path expression is not allowed in this context."
#define OB_ERR_JSON_BAD_ONE_OR_ALL_ARG__USER_ERROR_MSG "The oneOrAll argument may take these values: \'one\' or \'all\'."
#define OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE__USER_ERROR_MSG "Out of range JSON value for CAST"
#define OB_ERR_INVALID_JSON_VALUE_FOR_CAST__USER_ERROR_MSG "Invalid JSON value for CAST"
#define OB_ERR_JSON_OUT_OF_DEPTH__USER_ERROR_MSG "The JSON document exceeds the maximum depth."
#define OB_ERR_JSON_DOCUMENT_NULL_KEY__USER_ERROR_MSG "JSON documents may not contain NULL member names."
#define OB_ERR_BLOB_CANT_HAVE_DEFAULT__USER_ERROR_MSG "BLOB, TEXT, GEOMETRY or JSON column '%.*s' can't have a default value"
#define OB_ERR_INVALID_JSON_PATH_ARRAY_CELL__USER_ERROR_MSG "A path expression is not a path to a cell in an array"
#define OB_ERR_MISSING_JSON_VALUE__USER_ERROR_MSG "No value was found by '%.192s' on the specified path."
#define OB_ERR_MULTIPLE_JSON_VALUES__USER_ERROR_MSG "More than one value was found by '%.192s' on the specified path."
#define OB_ERR_WINDOW_ROWS_INTERVAL_USE__USER_ERROR_MSG "Window '%s': INTERVAL can only be used with RANGE frames."
#define OB_ERR_WINDOW_RANGE_FRAME_ORDER_TYPE__USER_ERROR_MSG "Window '%s' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression of numeric or temporal type"
#define OB_ERR_WINDOW_ILLEGAL_ORDER_BY__USER_ERROR_MSG "Window '%s': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression."
#define OB_TRANSACTION_SET_VIOLATION__USER_ERROR_MSG "Transaction set changed during the execution"
#define OB_TRANS_ROLLBACKED__USER_ERROR_MSG "transaction is rolled back"
#define OB_ERR_EXCLUSIVE_LOCK_CONFLICT__USER_ERROR_MSG "Lock wait timeout exceeded; try restarting transaction"
......@@ -3521,6 +3527,29 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_CANNOT_GRANT_STRING_TO_A_ROLE__ORA_USER_ERROR_MSG "ORA-01931: cannot grant %.*s to a role"
#define OB_ERR_CASCADE_CONSTRAINTS_MUST_BE_SPECIFIED_TO_PERFORM_THIS_REVOKE__ORA_USER_ERROR_MSG "ORA-01981: CASCADE CONSTRAINTS must be specified to perform this revoke"
#define OB_ERR_YOU_MAY_NOT_REVOKE_PRIVILEGES_FROM_YOURSELF__ORA_USER_ERROR_MSG "ORA-01749: you may not GRANT/REVOKE privileges to/from yourself"
#define OB_ERR_INVALID_JSON_TEXT__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON text."
#define OB_ERR_INVALID_JSON_TEXT_IN_PARAM__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON text in argument."
#define OB_ERR_INVALID_JSON_BINARY_DATA__ORA_USER_ERROR_MSG "ORA-00600: The JSON binary value contains invalid data."
#define OB_ERR_INVALID_JSON_PATH__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON path expression."
#define OB_ERR_INVALID_JSON_CHARSET__ORA_USER_ERROR_MSG "ORA-00600: Cannot create a JSON value from a string."
#define OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON character data provided to function."
#define OB_ERR_INVALID_TYPE_FOR_JSON__ORA_USER_ERROR_MSG "ORA-00600: Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required."
#define OB_ERR_INVALID_CAST_TO_JSON__ORA_USER_ERROR_MSG "ORA-00600: Cannot CAST value to JSON."
#define OB_ERR_INVALID_JSON_PATH_CHARSET__ORA_USER_ERROR_MSG "ORA-00600: A path expression must be encoded in the utf8 character set."
#define OB_ERR_INVALID_JSON_PATH_WILDCARD__ORA_USER_ERROR_MSG "ORA-00600: In this situation, path expressions may not contain the * and ** tokens."
#define OB_ERR_JSON_VALUE_TOO_BIG__ORA_USER_ERROR_MSG "ORA-00600: The JSON value is too big to be stored in a JSON column."
#define OB_ERR_JSON_KEY_TOO_BIG__ORA_USER_ERROR_MSG "ORA-00600: The JSON object contains a key name that is too long."
#define OB_ERR_JSON_USED_AS_KEY__ORA_USER_ERROR_MSG "ORA-00600: JSON column '%.*s' cannot be used in key specification."
#define OB_ERR_JSON_VACUOUS_PATH__ORA_USER_ERROR_MSG "ORA-00600: The path expression is not allowed in this context."
#define OB_ERR_JSON_BAD_ONE_OR_ALL_ARG__ORA_USER_ERROR_MSG "ORA-00600: The oneOrAll argument may take these values: \'one\' or \'all\'."
#define OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE__ORA_USER_ERROR_MSG "ORA-00600: Out of range JSON value for CAST"
#define OB_ERR_INVALID_JSON_VALUE_FOR_CAST__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON value for CAST"
#define OB_ERR_JSON_OUT_OF_DEPTH__ORA_USER_ERROR_MSG "ORA-00600: The JSON document exceeds the maximum depth."
#define OB_ERR_JSON_DOCUMENT_NULL_KEY__ORA_USER_ERROR_MSG "ORA-00600: JSON documents may not contain NULL member names."
#define OB_ERR_BLOB_CANT_HAVE_DEFAULT__ORA_USER_ERROR_MSG "ORA-00600: Invalid default value for \'%.*s\'"
#define OB_ERR_INVALID_JSON_PATH_ARRAY_CELL__ORA_USER_ERROR_MSG "ORA-00600: A path expression is not a path to a cell in an array"
#define OB_ERR_MISSING_JSON_VALUE__ORA_USER_ERROR_MSG "ORA-00600: No value was found by '%.192s' on the specified path."
#define OB_ERR_MULTIPLE_JSON_VALUES__ORA_USER_ERROR_MSG "ORA-00600: More than one value was found by '%.192s' on the specified path."
#define OB_ERR_SP_ALREADY_EXISTS__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5541, %s %.*s already exists"
#define OB_ERR_SP_DOES_NOT_EXIST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5542, %s %.*s.%.*s does not exist"
#define OB_ERR_SP_UNDECLARED_VAR__ORA_USER_ERROR_MSG "PLS-00201: identifier '%.*s' must be declared"
......@@ -3902,29 +3931,9 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_INCORRECT_VALUE_FOR_FUNCTION__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5936, Incorrect %.*s value: '%.*s' for function %.*s"
#define OB_ERR_USER_EXCEED_RESOURCE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5967, User '%.*s' has exceeded the '%s' resource (current value: %lu)"
#define OB_ERR_CTE_NEED_QUERY_BLOCKS__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5976, Recursive Common Table Expression should have one or more non-recursive query blocks followed by one or more recursive ones: %s"
#define OB_ERR_INVALID_JSON_TEXT__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON text."
#define OB_ERR_INVALID_JSON_TEXT_IN_PARAM__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON text in argument."
#define OB_ERR_INVALID_JSON_BINARY_DATA__ORA_USER_ERROR_MSG "ORA-00600: The JSON binary value contains invalid data."
#define OB_ERR_INVALID_JSON_PATH__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON path expression."
#define OB_ERR_INVALID_JSON_CHARSET__ORA_USER_ERROR_MSG "ORA-00600: Cannot create a JSON value from a string."
#define OB_ERR_INVALID_JSON_CHARSET_IN_FUNCTION__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON character data provided to function."
#define OB_ERR_INVALID_TYPE_FOR_JSON__ORA_USER_ERROR_MSG "ORA-00600: Invalid data type for JSON data in argument %u to function %s; a JSON string or JSON type is required."
#define OB_ERR_INVALID_CAST_TO_JSON__ORA_USER_ERROR_MSG "ORA-00600: Cannot CAST value to JSON."
#define OB_ERR_INVALID_JSON_PATH_CHARSET__ORA_USER_ERROR_MSG "ORA-00600: A path expression must be encoded in the utf8 character set."
#define OB_ERR_INVALID_JSON_PATH_WILDCARD__ORA_USER_ERROR_MSG "ORA-00600: In this situation, path expressions may not contain the * and ** tokens."
#define OB_ERR_JSON_VALUE_TOO_BIG__ORA_USER_ERROR_MSG "ORA-00600: The JSON value is too big to be stored in a JSON column."
#define OB_ERR_JSON_KEY_TOO_BIG__ORA_USER_ERROR_MSG "ORA-00600: The JSON object contains a key name that is too long."
#define OB_ERR_JSON_USED_AS_KEY__ORA_USER_ERROR_MSG "ORA-00600: JSON column '%.*s' cannot be used in key specification."
#define OB_ERR_JSON_VACUOUS_PATH__ORA_USER_ERROR_MSG "ORA-00600: The path expression is not allowed in this context."
#define OB_ERR_JSON_BAD_ONE_OR_ALL_ARG__ORA_USER_ERROR_MSG "ORA-00600: The oneOrAll argument may take these values: \'one\' or \'all\'."
#define OB_ERR_NUMERIC_JSON_VALUE_OUT_OF_RANGE__ORA_USER_ERROR_MSG "ORA-00600: Out of range JSON value for CAST"
#define OB_ERR_INVALID_JSON_VALUE_FOR_CAST__ORA_USER_ERROR_MSG "ORA-00600: Invalid JSON value for CAST"
#define OB_ERR_JSON_OUT_OF_DEPTH__ORA_USER_ERROR_MSG "ORA-00600: The JSON document exceeds the maximum depth."
#define OB_ERR_JSON_DOCUMENT_NULL_KEY__ORA_USER_ERROR_MSG "ORA-00600: JSON documents may not contain NULL member names."
#define OB_ERR_BLOB_CANT_HAVE_DEFAULT__ORA_USER_ERROR_MSG "ORA-00600: Invalid default value for \'%.*s\'"
#define OB_ERR_INVALID_JSON_PATH_ARRAY_CELL__ORA_USER_ERROR_MSG "ORA-00600: A path expression is not a path to a cell in an array"
#define OB_ERR_MISSING_JSON_VALUE__ORA_USER_ERROR_MSG "ORA-00600: No value was found by '%.192s' on the specified path."
#define OB_ERR_MULTIPLE_JSON_VALUES__ORA_USER_ERROR_MSG "ORA-00600: More than one value was found by '%.192s' on the specified path."
#define OB_ERR_WINDOW_ROWS_INTERVAL_USE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5983, Window '%s': INTERVAL can only be used with RANGE frames."
#define OB_ERR_WINDOW_RANGE_FRAME_ORDER_TYPE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5984, Window '%s' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression of numeric or temporal type"
#define OB_ERR_WINDOW_ILLEGAL_ORDER_BY__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5985, Window '%s': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression."
#define OB_TRANSACTION_SET_VIOLATION__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6001, Transaction set changed during the execution"
#define OB_TRANS_ROLLBACKED__ORA_USER_ERROR_MSG "ORA-24761: transaction rolled back"
#define OB_ERR_EXCLUSIVE_LOCK_CONFLICT__ORA_USER_ERROR_MSG "ORA-30006: resource busy; acquire with WAIT timeout expired"
......
......@@ -4976,8 +4976,10 @@ int ObSelectResolver::resolve_win_func_exprs(ObRawExpr*& expr, common::ObIArray<
LOG_WARN("failed to handle compat with mysql ntile.", K(ret));
} else if (N >= OB_MAX_WINDOW_FUNCTION_NUM) {
ret = OB_ERR_INVALID_WINDOW_FUNC_USE;
LOG_WARN("invalid window func num", K(ret), K(N), K(OB_MAX_WINDOW_FUNCTION_NUM));
} else if (OB_FAIL(check_orderby_type_validity(win_expr))) {
// need to check order by here, since the basic column type is resolve
LOG_WARN("invalid window func orderby type", K(ret), K(*win_expr));
} else if (OB_ISNULL(final_win_expr = select_stmt->get_same_win_func_item(win_expr))) {
ret = select_stmt->add_window_func_expr(win_expr);
} else if (ObRawExprUtils::replace_ref_column(expr, win_exprs.at(i), final_win_expr)) {
......@@ -5542,7 +5544,49 @@ int ObSelectResolver::identify_anchor_member(
return ret;
}
int ObSelectResolver::check_ntile_compatiable_with_mysql(ObWinFunRawExpr* win_expr)
int ObSelectResolver::check_orderby_type_validity(ObWinFunRawExpr *win_expr)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(win_expr)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("win expr is null.", K(ret));
} else if (win_expr->has_order_items() && win_expr->win_type_ == WINDOW_RANGE &&
(win_expr->get_upper().type_ == BOUND_INTERVAL || win_expr->get_lower().type_ == BOUND_INTERVAL)) {
for (int64_t i = 0; OB_SUCC(ret) && i < win_expr->order_items_.count(); i++) {
const OrderItem order_item = win_expr->order_items_.at(i);
if (OB_ISNULL(order_item.expr_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("win expr unexpected null order by", K(ret));
} else if (OB_FAIL(order_item.expr_->formalize(session_info_))) {
LOG_WARN("order item can't be formalized", K(ret));
} else {
ObObjType data_type = order_item.expr_->get_data_type();
if (share::is_mysql_mode()) {
if (data_type == 0 || // NULL
ob_is_int_tc(data_type) || ob_is_uint_tc(data_type) || ob_is_float_tc(data_type) ||
ob_is_double_tc(data_type) || ob_is_number_tc(data_type) || ob_is_datetime_tc(data_type) ||
ob_is_date_tc(data_type) || ob_is_otimestampe_tc(data_type) || ob_is_time_tc(data_type) ||
ob_is_year_tc(data_type)) {
// in mysql, only the above types are allowed in window order by.
} else {
ret = OB_ERR_WINDOW_RANGE_FRAME_ORDER_TYPE;
LOG_WARN("RANGE N PRECEDING/FOLLOWING frame order by type miss match", K(ret), K(data_type));
}
} else {
if (ob_is_number_tc(data_type) || ob_is_datetime_tc(data_type)) {
// the above type are allowed in oracle
} else {
ret = OB_ERR_INVALID_WINDOW_FUNC_USE;
LOG_WARN("invalid datatype in order by for range clause", K(ret), K(data_type));
}
}
}
}
}
return ret;
}
int ObSelectResolver::check_ntile_compatiable_with_mysql(ObWinFunRawExpr *win_expr)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(win_expr)) {
......
......@@ -406,6 +406,7 @@ private:
int check_duplicated_name_window(ObString& name, const ParseNode* node, int64_t resolved);
int mock_to_named_windows(ObString& name, ParseNode* win_node);
int can_find_group_column(ObRawExpr* col_expr, const common::ObIArray<ObRawExpr*>& exprs, bool& can_find);
int check_orderby_type_validity(ObWinFunRawExpr *win_expr);
int can_find_group_column(
ObRawExpr* col_expr, const common::ObIArray<ObGroupingSetsItem>& grouping_sets_items, bool& can_find);
int can_find_group_column(ObRawExpr* col_expr, const ObIArray<ObMultiRollupItem>& multi_rollup_items, bool& can_find);
......
......@@ -3876,7 +3876,17 @@ int ObRawExprResolverImpl::not_row_check(const ObRawExpr* expr)
return ret;
}
int ObRawExprResolverImpl::param_not_row_check(const ObRawExpr* expr)
int ObRawExprResolverImpl::not_int_check(const ObRawExpr *expr)
{
int ret = OB_SUCCESS;
if (share::is_mysql_mode() && NULL != expr && T_INT == expr->get_expr_type()) {
ret = OB_ERR_WINDOW_ILLEGAL_ORDER_BY;
LOG_WARN("int not expected in window function's orderby ", K(ret));
}
return ret;
}
int ObRawExprResolverImpl::param_not_row_check(const ObRawExpr *expr)
{
int ret = OB_SUCCESS;
for (int64_t i = 0; OB_SUCC(ret) && NULL != expr && i < expr->get_param_count(); i++) {
......@@ -4299,6 +4309,10 @@ int ObRawExprResolverImpl::process_sort_list_node(const ParseNode* node, ObIArra
LOG_WARN("fail to recursive resolve order item expr", K(ret));
} else {
OZ(not_row_check(order_item.expr_));
// check order_item.expr_:
// 1. shouldn't be int,
// 2. if is number, ignore the order_item.(all group are in same group);
OZ(not_int_check(order_item.expr_));
OZ(order_items.push_back(order_item));
}
}
......@@ -4343,6 +4357,21 @@ int ObRawExprResolverImpl::process_frame_node(const ParseNode* node, ObFrame& fr
LOG_WARN("process lower bound node failed", K(ret));
}
}
/* check the frame
* In mysql, ROWS can't coexists with (INTERVAL expr unit).
* mysql: select c1, sum(c1) over(order by c1 rows interval 5 day preceding) from t1;
* mysql will raise error: ERROR 3596 (HY000): INTERVAL can only be used with RANGE frames.
*/
if (OB_SUCC(ret) && share::is_mysql_mode() && frame.win_type_ == WINDOW_ROWS) {
if (frame.get_upper().type_ == BOUND_INTERVAL && !frame.get_upper().is_nmb_literal_) {
// upper is a (INTERVAL expr unit)
ret = OB_ERR_WINDOW_ROWS_INTERVAL_USE;
LOG_WARN("INTERVAL can only be used with RANGE frames.", K(ret));
} else if (frame.get_lower().type_ == BOUND_INTERVAL && !frame.get_lower().is_nmb_literal_) {
ret = OB_ERR_WINDOW_ROWS_INTERVAL_USE;
LOG_WARN("INTERVAL can only be used with RANGE frames.", K(ret));
}
}
}
}
......@@ -4524,9 +4553,16 @@ int ObRawExprResolverImpl::check_and_canonicalize_window_expr(ObRawExpr* expr)
}
}
if (OB_SUCC(ret) && share::is_mysql_mode() && w_expr->has_frame_orig() &&
WINDOW_RANGE == win_type && 0 == order_items.count()) {
ret = OB_ERR_MISS_ORDER_BY_EXPR;
if (OB_SUCC(ret) && share::is_mysql_mode() && w_expr->has_frame_orig() && WINDOW_RANGE == win_type &&
0 == order_items.count() &&
(w_expr->get_upper().type_ == BOUND_INTERVAL || w_expr->get_lower().type_ == BOUND_INTERVAL)) {
/* if preceding or following has a specific value (not the default unbounded)
* in mysql:
* @OK: select c1, sum(c1) over(range between current row and current row) from t1;
* @OK: select c1, sum(c1) over(range unbounded preceding) from t1;
* @error: select c1, sum(c1) over(range 1 preceding) from t1; --error 3587
*/
ret = OB_ERR_WINDOW_RANGE_FRAME_ORDER_TYPE;
LOG_WARN("missing ORDER BY expression in the window specification", K(ret));
}
......
......@@ -142,6 +142,7 @@ private:
static int not_row_check(const ObRawExpr* expr);
static int param_not_row_check(const ObRawExpr* expr);
int cast_accuracy_check(const ParseNode *node, const char *input);
static int not_int_check(const ObRawExpr *expr);
private:
int transform_ratio_afun_to_arg_div_sum(const ParseNode* ratio_to_report, ParseNode*& div);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册