[jOOQ/jOOQ#14584] Add bitwise operation support for EXASOL

This commit is contained in:
Lukas Eder 2023-02-07 09:46:36 +01:00
parent 7b2a4964d2
commit c04506e89d
9 changed files with 115 additions and 49 deletions

View File

@ -105,6 +105,11 @@ implements
case HSQLDB:
return true;
case FIREBIRD:
return true;
@ -133,6 +138,12 @@ implements
ctx.visit(function(N_BITAND, getDataType(), arg1, arg2));
break;
case FIREBIRD:
ctx.visit(function(N_BIN_AND, getDataType(), arg1, arg2));
break;

View File

@ -105,6 +105,11 @@ implements
case H2:
return true;
case FIREBIRD:
return true;
@ -137,6 +142,12 @@ implements
ctx.visit(function(N_BITNOT, getDataType(), arg1));
break;
case FIREBIRD:
ctx.visit(function(N_BIN_NOT, getDataType(), arg1));
break;

View File

@ -104,6 +104,11 @@ implements
case HSQLDB:
return true;
case FIREBIRD:
return true;
@ -136,6 +141,12 @@ implements
ctx.visit(function(N_BITOR, getDataType(), arg1, arg2));
break;
case FIREBIRD:
ctx.visit(function(N_BIN_OR, getDataType(), arg1, arg2));
break;

View File

@ -112,6 +112,7 @@ implements
case CUBRID:
case FIREBIRD:
case HSQLDB:
@ -154,6 +155,7 @@ implements
case CUBRID:

View File

@ -104,6 +104,11 @@ implements
case HSQLDB:
return true;
case FIREBIRD:
return true;
@ -135,6 +140,12 @@ implements
ctx.visit(function(N_BITXOR, getDataType(), arg1, arg2));
break;
case FIREBIRD:
ctx.visit(function(N_BIN_XOR, getDataType(), arg1, arg2));
break;

View File

@ -70,42 +70,18 @@ final class Names {
static final Name N_ARRAY = systemName("array");
static final Name N_ARRAY_AGG = systemName("array_agg");
static final Name N_ARRAY_LENGTH = systemName("array_length");
static final Name N_ASC = systemName("asc");
static final Name N_ASCII_CHAR = systemName("ascii_char");
static final Name N_ASCII_VAL = systemName("ascii_val");
static final Name N_ATN = systemName("atn");
static final Name N_ATN2 = systemName("atn2");
static final Name N_BIN_AND = systemName("bin_and");
static final Name N_BIN_NOT = systemName("bin_not");
static final Name N_BIN_OR = systemName("bin_or");
static final Name N_BIN_SHL = systemName("bin_shl");
static final Name N_BIN_SHR = systemName("bin_shr");
static final Name N_BIN_XOR = systemName("bin_xor");
static final Name N_BITAND = systemName("bitand");
static final Name N_BITCOUNT = systemName("bitcount");
static final Name N_BITNOT = systemName("bitnot");
static final Name N_BITOR = systemName("bitor");
static final Name N_BITSHIFTLEFT = systemName("bitshiftleft");
static final Name N_BITSHIFTRIGHT = systemName("bitshiftright");
static final Name N_BITXNOR = systemName("bitxnor");
static final Name N_BITXOR = systemName("bitxor");
static final Name N_BIT_AND = systemName("bit_and");
static final Name N_BIT_NAND = systemName("bit_nand");
static final Name N_BIT_NOR = systemName("bit_nor");
static final Name N_BIT_NOT = systemName("bit_not");
static final Name N_BIT_OR = systemName("bit_or");
static final Name N_BIT_XNOR = systemName("bit_xnor");
static final Name N_BIT_XOR = systemName("bit_xor");
static final Name N_BOOLAND_AGG = systemName("booland_agg");
static final Name N_BOOLOR_AGG = systemName("boolor_agg");
static final Name N_BYTEA = systemName("bytea");
static final Name N_BYTE_LENGTH = systemName("byte_length");
static final Name N_CAST = systemName("cast");
static final Name N_CEILING = systemName("ceiling");
static final Name N_CHAR = systemName("char");
static final Name N_CHARINDEX = systemName("charindex");
static final Name N_CHOOSE = systemName("choose");
static final Name N_COALESCE = systemName("coalesce");
static final Name N_COLLECT = systemName("collect");
static final Name N_CONCAT = systemName("concat");
static final Name N_CONVERT = systemName("convert");
@ -150,11 +126,8 @@ final class Names {
static final Name N_GENERATE_ARRAY = systemName("generate_array");
static final Name N_GENERATE_SERIES = systemName("generate_series");
static final Name N_GENERATE_UNIQUE = systemName("generate_unique");
static final Name N_GENERATE_UUID = systemName("generate_uuid");
static final Name N_GENERATOR = systemName("generator");
static final Name N_GENGUID = systemName("genguid");
static final Name N_GEN_ID = systemName("gen_id");
static final Name N_GEN_RANDOM_UUID = systemName("gen_random_uuid");
static final Name N_GEN_UUID = systemName("gen_uuid");
static final Name N_GETDATE = systemName("getdate");
static final Name N_GREATEST = systemName("greatest");
@ -162,9 +135,7 @@ final class Names {
static final Name N_GROUP_CONCAT = systemName("group_concat");
static final Name N_HASHBYTES = systemName("hashbytes");
static final Name N_HASH_MD5 = systemName("hash_md5");
static final Name N_HEX = systemName("hex");
static final Name N_IF = systemName("if");
static final Name N_IFNULL = systemName("ifnull");
static final Name N_IIF = systemName("iif");
static final Name N_INSERT = systemName("insert");
static final Name N_INSERTED = systemName("inserted");
@ -201,20 +172,14 @@ final class Names {
static final Name N_JSON_VALUE = systemName("json_value");
static final Name N_LAG = systemName("lag");
static final Name N_LAST_VALUE = systemName("last_value");
static final Name N_LCASE = systemName("lcase");
static final Name N_LEAD = systemName("lead");
static final Name N_LEAST = systemName("least");
static final Name N_LEN = systemName("len");
static final Name N_LENGTH = systemName("length");
static final Name N_LENGTHB = systemName("lengthb");
static final Name N_LIST = systemName("list");
static final Name N_LISTAGG = systemName("listagg");
static final Name N_LOCATE = systemName("locate");
static final Name N_LOCK_TIMEOUT = systemName("lock_timeout");
static final Name N_LOGICAL_AND = systemName("logical_and");
static final Name N_LOGICAL_OR = systemName("logical_or");
static final Name N_LOGN = systemName("logn");
static final Name N_LSHIFT = systemName("lshift");
static final Name N_MAP = systemName("map");
static final Name N_MAXVALUE = systemName("maxvalue");
static final Name N_MID = systemName("mid");
@ -226,7 +191,6 @@ final class Names {
static final Name N_MULTISET_AGG = systemName("multiset_agg");
static final Name N_NANO100_BETWEEN = systemName("nano100_between");
static final Name N_NEG = systemName("neg");
static final Name N_NEWID = systemName("newid");
static final Name N_NEXTVAL = systemName("nextval");
static final Name N_NOT = systemName("not");
static final Name N_NOW = systemName("now");
@ -239,7 +203,6 @@ final class Names {
static final Name N_OPENXML = systemName("openxml");
static final Name N_ORDINAL = systemName("ordinal");
static final Name N_OREPLACE = systemName("oreplace");
static final Name N_OTRANSLATE = systemName("otranslate");
static final Name N_PERCENTILE_CONT = systemName("percentile_cont");
static final Name N_PERCENTILE_DISC = systemName("percentile_disc");
static final Name N_PERCENT_RANK = systemName("percent_rank");
@ -248,9 +211,7 @@ final class Names {
static final Name N_PLUS = systemName("plus");
static final Name N_POWER = systemName("power");
static final Name N_PRINTF = systemName("printf");
static final Name N_RANDOM = systemName("random");
static final Name N_RANDOMBLOB = systemName("randomblob");
static final Name N_RANDOM_UUID = systemName("random_uuid");
static final Name N_RANK = systemName("rank");
static final Name N_RATIO_TO_REPORT = systemName("ratio_to_report");
static final Name N_RAWTOHEX = systemName("rawtohex");
@ -258,7 +219,6 @@ final class Names {
static final Name N_REGEXP_REPLACE = systemName("regexp_replace");
static final Name N_REGEX_REPLACE = systemName("regex_replace");
static final Name N_REPLACE_REGEXPR = systemName("replace_regexpr");
static final Name N_REPLICATE = systemName("replicate");
static final Name N_RESULT = systemName("result");
static final Name N_RND = systemName("rnd");
static final Name N_ROLLUP = systemName("rollup");
@ -267,14 +227,10 @@ final class Names {
static final Name N_ROWID = systemName("rowid");
static final Name N_ROWSFROM = systemName("rowsfrom");
static final Name N_ROW_NUMBER = systemName("row_number");
static final Name N_RSHIFT = systemName("rshift");
static final Name N_SCHEMA_NAME = systemName("schema_name");
static final Name N_SECONDS_BETWEEN = systemName("seconds_between");
static final Name N_SEQ4 = systemName("seq4");
static final Name N_SEQ8 = systemName("seq8");
static final Name N_SGN = systemName("sgn");
static final Name N_SHIFTLEFT = systemName("shiftleft");
static final Name N_SHIFTRIGHT = systemName("shiftright");
static final Name N_SHL = systemName("shl");
static final Name N_SHR = systemName("shr");
static final Name N_SPLIT = systemName("split");
@ -288,7 +244,6 @@ final class Names {
static final Name N_SQL_TSI_SECOND = systemName("sql_tsi_second");
static final Name N_SQL_TSI_WEEK = systemName("sql_tsi_week");
static final Name N_SQL_TSI_YEAR = systemName("sql_tsi_year");
static final Name N_SQR = systemName("sqr");
static final Name N_STANDARD_HASH = systemName("standard_hash");
static final Name N_STATS_MODE = systemName("stats_mode");
static final Name N_STDDEV = systemName("stddev");
@ -298,7 +253,6 @@ final class Names {
static final Name N_STRFTIME = systemName("strftime");
static final Name N_STRING_AGG = systemName("string_agg");
static final Name N_STRING_SPLIT = systemName("string_split");
static final Name N_STRREVERSE = systemName("strreverse");
static final Name N_STRTOK = systemName("strtok");
static final Name N_STR_REPLACE = systemName("str_replace");
static final Name N_ST_NUMINTERIORRINGS = systemName("st_numinteriorrings");
@ -318,11 +272,8 @@ final class Names {
static final Name N_TO_NUMBER = systemName("to_number");
static final Name N_TRUNCATE = systemName("truncate");
static final Name N_TRUNCNUM = systemName("truncnum");
static final Name N_UCASE = systemName("ucase");
static final Name N_UNNEST = systemName("unnest");
static final Name N_USER = systemName("user");
static final Name N_UUID_GENERATE = systemName("uuid_generate");
static final Name N_UUID_STRING = systemName("uuid_string");
static final Name N_UUID_TO_CHAR = systemName("uuid_to_char");
static final Name N_VALUE = systemName("value");
static final Name N_VALUES = systemName("values");
@ -357,27 +308,53 @@ final class Names {
static final Name N_ARRAY_PREPEND = systemName("array_prepend");
static final Name N_ARRAY_REMOVE = systemName("array_remove");
static final Name N_ARRAY_REPLACE = systemName("array_replace");
static final Name N_ASC = systemName("asc");
static final Name N_ASCII = systemName("ascii");
static final Name N_ASCII_CHAR = systemName("ascii_char");
static final Name N_ASCII_VAL = systemName("ascii_val");
static final Name N_ASIN = systemName("asin");
static final Name N_ASINH = systemName("asinh");
static final Name N_ATAN = systemName("atan");
static final Name N_ATAN2 = systemName("atan2");
static final Name N_ATANH = systemName("atanh");
static final Name N_ATN = systemName("atn");
static final Name N_ATN2 = systemName("atn2");
static final Name N_AVG = systemName("avg");
static final Name N_BIN_AND = systemName("bin_and");
static final Name N_BIN_NOT = systemName("bin_not");
static final Name N_BIN_OR = systemName("bin_or");
static final Name N_BIN_SHL = systemName("bin_shl");
static final Name N_BIN_SHR = systemName("bin_shr");
static final Name N_BIN_XOR = systemName("bin_xor");
static final Name N_BITAND = systemName("bitand");
static final Name N_BITNOT = systemName("bitnot");
static final Name N_BITOR = systemName("bitor");
static final Name N_BITSHIFTLEFT = systemName("bitshiftleft");
static final Name N_BITSHIFTRIGHT = systemName("bitshiftright");
static final Name N_BITXOR = systemName("bitxor");
static final Name N_BIT_AND = systemName("bit_and");
static final Name N_BIT_AND_AGG = systemName("bit_and_agg");
static final Name N_BIT_COUNT = systemName("bit_count");
static final Name N_BIT_LENGTH = systemName("bit_length");
static final Name N_BIT_LSHIFT = systemName("bit_lshift");
static final Name N_BIT_NAND_AGG = systemName("bit_nand_agg");
static final Name N_BIT_NOR_AGG = systemName("bit_nor_agg");
static final Name N_BIT_NOT = systemName("bit_not");
static final Name N_BIT_OR = systemName("bit_or");
static final Name N_BIT_OR_AGG = systemName("bit_or_agg");
static final Name N_BIT_RSHIFT = systemName("bit_rshift");
static final Name N_BIT_XNOR_AGG = systemName("bit_xnor_agg");
static final Name N_BIT_XOR = systemName("bit_xor");
static final Name N_BIT_XOR_AGG = systemName("bit_xor_agg");
static final Name N_BOOL_AND = systemName("bool_and");
static final Name N_BOOL_OR = systemName("bool_or");
static final Name N_CARDINALITY = systemName("cardinality");
static final Name N_CEIL = systemName("ceil");
static final Name N_CEILING = systemName("ceiling");
static final Name N_CHAR = systemName("char");
static final Name N_CHAR_LENGTH = systemName("char_length");
static final Name N_CHR = systemName("chr");
static final Name N_COALESCE = systemName("coalesce");
static final Name N_CONDITION = systemName("condition");
static final Name N_CONNECT_BY_ISCYCLE = systemName("connect_by_iscycle");
static final Name N_CONNECT_BY_ISLEAF = systemName("connect_by_isleaf");
@ -404,7 +381,12 @@ final class Names {
static final Name N_EXP = systemName("exp");
static final Name N_FIELD = systemName("field");
static final Name N_FLOOR = systemName("floor");
static final Name N_GENERATE_UUID = systemName("generate_uuid");
static final Name N_GENGUID = systemName("genguid");
static final Name N_GEN_RANDOM_UUID = systemName("gen_random_uuid");
static final Name N_GOTO = systemName("goto");
static final Name N_HEX = systemName("hex");
static final Name N_IFNULL = systemName("ifnull");
static final Name N_INSERTING = systemName("inserting");
static final Name N_JSONB_ARRAY = systemName("jsonb_array");
static final Name N_JSONB_GET_ATTRIBUTE = systemName("jsonb_get_attribute");
@ -428,23 +410,31 @@ final class Names {
static final Name N_JSON_REMOVE = systemName("json_remove");
static final Name N_JSON_REPLACE = systemName("json_replace");
static final Name N_JSON_SET = systemName("json_set");
static final Name N_LCASE = systemName("lcase");
static final Name N_LEFT = systemName("left");
static final Name N_LEN = systemName("len");
static final Name N_LENGTH = systemName("length");
static final Name N_LENGTHB = systemName("lengthb");
static final Name N_LEVEL = systemName("level");
static final Name N_LN = systemName("ln");
static final Name N_LOCAL_DATE_ADD = systemName("local_date_add");
static final Name N_LOCAL_DATE_TIME_ADD = systemName("local_date_time_add");
static final Name N_LOG = systemName("log");
static final Name N_LOG10 = systemName("log10");
static final Name N_LOGN = systemName("logn");
static final Name N_LOWER = systemName("lower");
static final Name N_LPAD = systemName("lpad");
static final Name N_LSHIFT = systemName("lshift");
static final Name N_LTRIM = systemName("ltrim");
static final Name N_MAX = systemName("max");
static final Name N_MD5 = systemName("md5");
static final Name N_MEDIAN = systemName("median");
static final Name N_MIN = systemName("min");
static final Name N_NEWID = systemName("newid");
static final Name N_NULLIF = systemName("nullif");
static final Name N_NVL = systemName("nvl");
static final Name N_OCTET_LENGTH = systemName("octet_length");
static final Name N_OTRANSLATE = systemName("otranslate");
static final Name N_OVERLAY = systemName("overlay");
static final Name N_PI = systemName("pi");
static final Name N_POSITION = systemName("position");
@ -452,6 +442,8 @@ final class Names {
static final Name N_PRODUCT = systemName("product");
static final Name N_RADIANS = systemName("radians");
static final Name N_RAND = systemName("rand");
static final Name N_RANDOM = systemName("random");
static final Name N_RANDOM_UUID = systemName("random_uuid");
static final Name N_REGR_AVGX = systemName("regr_avgx");
static final Name N_REGR_AVGY = systemName("regr_avgy");
static final Name N_REGR_COUNT = systemName("regr_count");
@ -463,23 +455,30 @@ final class Names {
static final Name N_REGR_SYY = systemName("regr_syy");
static final Name N_REPEAT = systemName("repeat");
static final Name N_REPLACE = systemName("replace");
static final Name N_REPLICATE = systemName("replicate");
static final Name N_RETURN_ = systemName("return_");
static final Name N_REVERSE = systemName("reverse");
static final Name N_RIGHT = systemName("right");
static final Name N_ROUND = systemName("round");
static final Name N_ROWNUM = systemName("rownum");
static final Name N_RPAD = systemName("rpad");
static final Name N_RSHIFT = systemName("rshift");
static final Name N_RTRIM = systemName("rtrim");
static final Name N_SGN = systemName("sgn");
static final Name N_SHIFTLEFT = systemName("shiftleft");
static final Name N_SHIFTRIGHT = systemName("shiftright");
static final Name N_SIGN = systemName("sign");
static final Name N_SIGNAL_SQLSTATE = systemName("signal_sqlstate");
static final Name N_SIN = systemName("sin");
static final Name N_SINH = systemName("sinh");
static final Name N_SPACE = systemName("space");
static final Name N_SPLIT_PART = systemName("split_part");
static final Name N_SQR = systemName("sqr");
static final Name N_SQRT = systemName("sqrt");
static final Name N_SQUARE = systemName("square");
static final Name N_STDDEV_POP = systemName("stddev_pop");
static final Name N_STDDEV_SAMP = systemName("stddev_samp");
static final Name N_STRREVERSE = systemName("strreverse");
static final Name N_ST_AREA = systemName("st_area");
static final Name N_ST_ASBINARY = systemName("st_asbinary");
static final Name N_ST_ASTEXT = systemName("st_astext");
@ -530,10 +529,13 @@ final class Names {
static final Name N_TRANSLATE = systemName("translate");
static final Name N_TRIM = systemName("trim");
static final Name N_TRUNC = systemName("trunc");
static final Name N_UCASE = systemName("ucase");
static final Name N_UNIQUE = systemName("unique");
static final Name N_UPDATING = systemName("updating");
static final Name N_UPPER = systemName("upper");
static final Name N_UUID = systemName("uuid");
static final Name N_UUID_GENERATE = systemName("uuid_generate");
static final Name N_UUID_STRING = systemName("uuid_string");
static final Name N_VAR_POP = systemName("var_pop");
static final Name N_VAR_SAMP = systemName("var_samp");
static final Name N_WIDTH_BUCKET = systemName("width_bucket");

View File

@ -8455,6 +8455,10 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
return bitLength((Field) parseFieldParenthesised());
else if (parseFunctionNameIf("BITCOUNT", "BIT_COUNT"))
return bitCount((Field) parseFieldNumericOpParenthesised());
else if (parseKeywordIf("BIT_LSHIFT"))
return parseFunctionArgs2(() -> toField(parseNumericOp()), (f1, f2) -> shl(f1, f2));
else if (parseKeywordIf("BIT_RSHIFT"))
return parseFunctionArgs2(() -> toField(parseNumericOp()), (f1, f2) -> shr(f1, f2));
else if (parseFunctionNameIf("BYTE_LENGTH"))
return octetLength((Field) parseFieldParenthesised());
else if ((field = parseFieldBitwiseFunctionIf()) != null)

View File

@ -117,6 +117,9 @@ implements
case HSQLDB:
@ -164,6 +167,10 @@ implements

View File

@ -117,6 +117,9 @@ implements
case HSQLDB:
@ -164,6 +167,10 @@ implements