- Apr 15, 2021
-
-
Mergen Imeev authored
This patch introduces mem_cast_explicit(). This function is used to convert a MEM to a given field type according to explicit cast rules. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_to_str() and mem_to_str0() functions. These functions are used to convert a MEM to a MEM that contains string value. These functions defines the rules that are used during convertion from values of all other types to STRING. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_to_number(). This function is used to convert MEM to MEM contains number. Part of #5818
-
Mergen Imeev authored
This patch intruduces mem_to_double(). This function is used to convert a MEM to a MEM that contains double value. This function defines the rules that are used during conversion from values of all other types to double. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_to_int() and mem_to_int_precise() functions. These functions are used to convert a MEM to a MEM that contains integer value. These functions defines the rules that are used during convertion from values of all other types to INTEGER. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_null_clear() function. This function sets "cleared" NULL to MEM. This NULL is used only in internal VDBE operations. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_agg() function. This function stores aggregation function to MEM and allocates enough memory to hold accumulation structure for aggregate function. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_frame() function. This function clears the MEM and sets a frame to MEM. Frames used for internal VDBE operations. Part of #5818
-
Mergen Imeev authored
This patch refactors mem_set_ptr() function. Also, it moves the function to all others mem_set_*() functions. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_invalid() function. This function clears MEM and invalidates it. Part of #5818
-
Mergen Imeev authored
This patch introduces set of mem_set_*() functions for MAP and ARRAY. These functions clears MEM and sets it to given binary value. Binary value must be MAP or ARRAY. Degree of clearing and type of allocation of the binary value is determined by the function used. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_zerobin() function. This function clears MEM and sets it to binary value that consists of given number of zero bytes. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_copy_bin() function. This function copies given binary value to a newly allocated by MEM memory. Part of #5818
-
Mergen Imeev authored
This patch introduces set of mem_set_bin_*() functions. These functions clears MEM and sets it to given binary value. Degree of clearing and type of allocation of the binary value is determined by the function used. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_copy_str() and mem_copy_str0() functions. These functions copy given string to newly allocated by MEM memory. String given to mem_copy_str0() should be NULL-terminated. This is not necessary for mem_copy_str(). Part of #5818
-
Mergen Imeev authored
This patch introduces set of mem_set_str_*() functions. These functions clears MEM and sets it to given string value. Degree of clearing and type of allocation of the string is determined by the function used. Part of #5818
-
Mergen Imeev authored
This patch performs a small refactoring of mem_set_double() and moves this function and mem_set_bool() to another place so that they are part of the code block containing all mem_set_*() functions. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_uint(). This function clears MEM and sets it to given unsigned value. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_int(). This function clears MEM and sets it to given integer value. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_set_null(). This function clears MEM and sets it to NULL. Part of #5818
-
Mergen Imeev authored
This patch adds initialization for newly created MEM objects in sqlVdbeAllocUnpackedRecord(). Changing a MEM without being initialized may give us unexpected result. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_bit_and(), mem_bit_or(), mem_shift_left(), mem_shift_right(), and mem_bit_not(), which perform bitwise operations on MEM. Part of #5818
-
Mergen Imeev authored
This patch introduces set of mem_cmp_*() functions. These functions are used to compare MEMs. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_add(), mem_sub(), mem_mul(), mem_div() and mem_rem(), which perform arithmetic operations on two MEMs. Operands must contain values of numeric types or values that can be converted to a number according to implicit casting rules. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_concat(). Function mem_concat() concatenates values from two MEMs in case these values are strings or binaries and writes the result to the third MEM. Part of #5818
-
Mergen Imeev authored
Function sql_column_to_messagepack() has almost the same functionality as sql_vdbe_mem_encode_tuple(). Due to this it is not necessary to have sql_column_to_messagepack(), so it is removed in this commit. Part of #5818
-
Mergen Imeev authored
The original vdbe_decode_msgpack_into_mem() returns a MEM that contains string and binary values as ephemeral. This patch renames this function to mem_from_mp_ephemeral() and introduces new function mem_from_mp(), which returns a MEM that contains string and binary values in newly allocated memory. This patch changes behavior for this query: CREATE TABLE t1(m VARBINARY primary key); INSERT INTO t1 VALUES(x'6178'), (x'6278'), (x'6379'); SELECT count(*), substr(m,2,1) AS mx FROM t1 GROUP BY mx; Before this patch: tarantool> SELECT count(*), substr(m,2,1) AS mx FROM t1 GROUP BY mx; --- - metadata: - name: COLUMN_1 type: integer - name: MX type: string rows: - [2, 'y'] - [1, 'y'] ... After this patch. tarantool> SELECT count(*), substr(m,2,1) AS mx FROM t1 GROUP BY mx; --- - metadata: - name: COLUMN_1 type: integer - name: MX type: string rows: - [2, 'x'] - [1, 'y'] ... Part of #5818 Closes #5890
-
Mergen Imeev authored
This patch reworks mem_move(). This function moves all content of source MEM to destination MEM. Source mem is set to NULL. Part of #5818
-
Mergen Imeev authored
This patch intoduces mem_copy_as_ephemeral(). This function copies value from source MEM to destination MEM. In case value is of string or binary type and its allocation type is not static, it copied as value with ephemeral allocation type. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_copy(). This function copies value from source MEM to destination MEM. In case value is string or binary and have not static allocation type, it is copied to newly allocated memory. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_is_*() functions that allows to check current MEM state. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_destroy(). This function should be used to free and destroy all objects owned by MEM, if necessary. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_create(). This function should be used to initialize a MEM. MEM should be initialized before usage. Part of #5818
-
Mergen Imeev authored
This patch introduces mem_str() which allows to receive value of MEM as a string. Due to the limitations of static_alloc(), this function cannot be used to safely retrieve a value of MEM converted to string. This function is suitable for debugging, displaying the value in an error message, etc. Part of #5818
-
Mergen Imeev authored
This patch disables unused code in sql/vdbemem.c. It will simplify refactoring. Part of #5818
-
Mergen Imeev authored
Part of #5818
-
Mergen Imeev authored
This patch simplifies port_vdbemem_dump_lua() and port_vdbemem_get_msgpack() functions. Part of #5818
-
Mergen Imeev authored
This patch moves all MEM-related functions in mem.c/mem.h. Part of #5818
-
Mergen Imeev authored
There is no need for NULL-termination, since MEMs converted to msgpack and msgpack do not require NULL-terminated strings. Needed for #5818
-
Mergen Imeev authored
This patch disables unused code in sql/legacy.c. It will simplify refactoring. Needed for #5818
-