SQL statement, type, timezone and cache parameters
These parameters are set in coradb.conf. For how to set them, which ones can be changed while the server runs, and the full list of parameters, see System parameters.
Statement/type-related parameters
Section titled “Statement/type-related parameters”The following are parameters related to SQL statements and data types supported by CoraDB. The type and value range for each parameter are as follows:
| Parameter name | Type | Default | Min | Max |
|---|---|---|---|---|
| add_column_update_hard_default | bool | no | ||
| alter_table_change_type_strict | bool | yes | ||
| allow_truncated_string | bool | no | ||
| ansi_quotes | bool | yes | ||
| block_ddl_statement | bool | no | ||
| block_nowhere_statement | bool | no | ||
| compat_numeric_division_scale | bool | no | ||
| create_table_reuseoid | bool | yes | ||
| cte_max_recursions | int | 2,000 | 2 | 1,000,000 |
| default_week_format | int | 0 | ||
| group_concat_max_len | byte | 1,024 | 4 | 33,554,432 |
| intl_check_input_string | bool | no | ||
| intl_collation | string | |||
| intl_date_lang | string | |||
| intl_number_lang | string | |||
| json_max_array_idx | int | 65,536 | 1,024 | 1,048,576 |
| no_backslash_escapes | bool | yes | ||
| only_full_group_by | bool | no | ||
| oracle_style_empty_string | bool | no | ||
| pipes_as_concat | bool | yes | ||
| plus_as_concat | bool | yes | ||
| require_like_escape_character | bool | no | ||
| return_null_on_function_errors | bool | no | ||
| string_max_size_bytes | byte | 1,048,576 | 64 | 33,554,432 |
| unicode_input_normalization | bool | no | ||
| unicode_output_normalization | bool | no | ||
| update_use_attribute_references | bool | no |
add_column_update_hard_default
Section titled “add_column_update_hard_default”add_column_update_hard_default is a parameter to configure whether or not to provide the hard default value as the input value for a column when you add a new column to the ALTER TABLE ... ADD COLUMN clause.
When there is NOT NULL constraint and no DEFAULT constraint, if a value of this parameter is set to yes, the value of newly added column will be inserted as hard default value; if it is set to no, CoraDB returns an error. For the hard default for each type, see the CHANGE/MODIFY clauses of the ALTER TABLE statement.
SET SYSTEM PARAMETERS 'add_column_update_hard_default=yes';
CREATE TABLE tbl (i int);INSERT INTO tbl VALUES (1),(2);ALTER TABLE tbl ADD COLUMN j INT NOT NULL;
SELECT * FROM tbl;i j=========================1 02 0SET SYSTEM PARAMETERS 'add_column_update_hard_default=no';
CREATE TABLE tbl (i INT);INSERT INTO tbl VALUES (1),(2);ALTER TABLE tbl ADD COLUMN j INT NOT NULL;ERROR: Cannot add NOT NULL constraint for attribute "j": there are existing NULL values for this attribute.alter_table_change_type_strict
Section titled “alter_table_change_type_strict”alter_table_change_type_strict is a parameter to configure whether to allow the conversion of column values according to the type change, and the default value is yes. If a value for this parameter is set to no, the value may be changed when you change the column types or when you add NOT NULL constraints; if it is set to yes, the value does not change. For details, see CHANGE Clause in the CHANGE/MODIFY clauses.
allow_truncated_string
Section titled “allow_truncated_string”allow_truncated_string is a parameter to configure whether to allow the truncation of string values according to the string manipulation operations used in insert or update query, and the default value is no. If the value for this parameter is set to no, the string value is not allowed to be truncated when you do operation for any string related to insert or update query; however the string related to select query may be truncated regardless of this configuration. If it is set to yes, the string value may be truncated regardless of the type of (INSERT/UPDATE/SELECT) query.
ansi_quotes
Section titled “ansi_quotes”ansi_quotes is a parameter used to enclose symbols and character string to handle identifiers. The default value is yes. If this parameter value is set to yes, double quotations are handled as identifier symbols and single quotations are handled as character string symbols. If it is set to no, both double and single quotations are handled as character string symbols.
block_ddl_statement
Section titled “block_ddl_statement”block_ddl_statement is a parameter used to limit the execution of DDL (Data Definition Language) statements by the client. If the parameter is set to no, the given client is allowed to execute DDL statements. If it is set to yes, the client is not permitted to execute DDL statements. The default value is no.
block_nowhere_statement
Section titled “block_nowhere_statement”block_nowhere_statement is a parameter used to limit the execution of UPDATE / DELETE statements without a condition clause (WHERE) by the client. If the parameter is set to no, the given client is allowed to execute UPDATE / DELETE statements without a condition clause. If it is set to yes, the client is not permitted to execute UPDATE / DELETE statements without a condition clause. The default value is no.
compat_numeric_division_scale
Section titled “compat_numeric_division_scale”compat_numeric_division_scale is a parameter to configure the scale to be displayed in the result (quotient) of a division operation. If the parameter is set to no, the scale of the quotient is 9, if it is set to yes, the scale is determined by that of the operand. The default value is no.
create_table_reuseoid
Section titled “create_table_reuseoid”create_table_reuseoid is a parameter to specify whether to use the REUSE_OID or DONT_REUSE_OID option when creating a table without table option. If it is set to yes, the table is created with REUSE_OID option. The default value is yes.
For detail, see REUSE_OID and DONT_REUSE_OID .
cte_max_recursions
Section titled “cte_max_recursions”cte_max_recursions is a parameter to limit the maximum number of iterations when executing the recursive part of the CTE (Common Table Expressions) statement. This avoids infinite loop and potential issues produced by the size of temporary lists.
default_week_format
Section titled “default_week_format”default_week_format is a parameter to configure default value for the mode attribute of the WEEK function. The default value is 0. For details, see WEEK.
intl_check_input_string
Section titled “intl_check_input_string”intl_check_input_string is a parameter to determine whether or not to check that string entered is correctly corresponded to character set used. The default value is no. If this value is no and character set is UTF-8 and incorrect data is enter which violate UTF-8 byte sequence, it can show abnormal behavior or database server and applications can be terminated abnormally. However, if it is guaranteed this problem does not happen, it has advantage in performance not to do it.
UTF-8 and EUC-KR can be checked; ISO-8859-1 is one-byte encoding so it does not have to be checked because every byte is valid.
group_concat_max_len
Section titled “group_concat_max_len”group_concat_max_len is a parameter used to limit the return value size of the GROUP_CONCAT function. You can set a unit as B, K, M, G or T, which stands for bytes, kilobytes(KB), megabytes(MB), gigabytes(GB) or terabytes(TB) respectively. If you omit the unit, bytes will be applied. The default value is 1,024. The minimum value is 4 and the maximum value is 33,554,432 bytes.
This function is affected by string_max_size_bytes parameter; if the value of group_concat_max_len is greater than the value string_max_size_bytes and the result size of GROUP_CONCAT exceeds the value of string_max_size_bytes, an error occurs.
intl_check_input_string
Section titled “intl_check_input_string”intl_check_input_string is a parameter to determine whether or not to check that string entered is correctly corresponded to character set used. The default value is no. If this value is no and character set is UTF-8 and incorrect data is enter which violate UTF-8 byte sequence, it can show abnormal behavior or database server and applications can be terminated abnormally. However, if it is guaranteed this problem does not happen, it has advantage in performance not to do it.
UTF-8 and EUC-KR can be checked; ISO-8859-1 is one-byte encoding so it does not have to be checked because every byte is valid.
intl_collation
Section titled “intl_collation”intl_collation is a parameter which specifies a collation name about a specific application client. Specifying this parameter is the same as changing a collation of application client by using "SET NAMES" statement. Specifying a collation includes a charset.
The following two statements behave the same.
SET NAMES utf8;SET SYSTEM PARAMETERS 'intl_collation=utf8_bin';For an available value of intl_collation, see Collation.
intl_date_lang
Section titled “intl_date_lang”intl_date_lang is a parameter used to input/output the values of TIME, DATE, DATETIME, and TIMESTAMP. If language name is omitted, it specifies a locale format of string of localized calendar (month, weekday, and AM/PM).
The values allowed are as follows: Note that to use all values, locale library should be configured except built-in locale. For configuring locale, see Locale setting.
| Language | Locale name of language |
|---|---|
| English | en_US |
| German | de_DE |
| Spanish | es_ES |
| French | fr_FR |
| Italian | it_IT |
| Japanese | ja_JP |
| Cambodian | km_KH |
| Korean | ko_KR |
| Turkish | tr_TR |
| Vietnamese | vi_VN |
| Chinese | zh_CN |
| Romanian | ro_RO |
The function recognizing input string based on calendar format of specified language is as follows:
The function outputting string based on calendar format of specified language is as follows:
intl_number_lang
Section titled “intl_number_lang”intl_number_lang is a parameter used to specify locale applied when numeric format is assigned to input/output string in the function where a string is converted to number or number is converted to string. A delimiter and decimal symbol are used for numeric localization. In general, a comma and period are used; however, it can be changeable based on locale. For example, while number 1000.12 is written as 1,000.12 in most locale, it is written as 1.000,12 in tr_TR locale.
The function recognizing input string based on calendar format of specified language is as follows:
The function outputting string based on calendar format of specified language is as follows:
json_max_array_idx
Section titled “json_max_array_idx”json_max_array_idx is a parameter used by JSON functions to set a limit on the size of arrays after changes.
If a very large index is fed to functions like JSON_ARRAY_INSERT by accident, the JSON document will occupy a lot of memory and disk space. Use this parameter to limit the risks.
The limit is not applied to arrays generated by parsing strings.
no_backslash_escapes
Section titled “no_backslash_escapes”no_backslash_escapes is a parameter to configure whether or not to use backslash (\ as an escape character, and the default value is yes. If a value for this parameter is set to no, backslash (\ will be used as an escape character; if it is set to yes, backslash (\ will be used as a normal character. For example, if this value is set to no, "\n" means a newline character. For details, see Escape special characters.
only_full_group_by
Section titled “only_full_group_by”only_full_group_by is a parameter to configure whether or not to use extended syntax about using GROUP BY statement.
If this parameter value is set to no, an extended syntax is applied thus, a column that is not specified in the GROUP BY statement can be specified in the SELECT column list. If it is set to yes, a column that is only specified in the GROUP BY statement can be the SELECT column list.
The default value is no. Therefore, specify the only_full_group_by parameter value to yes to execute queries by SQL standards. Because the extended syntax is not applied in this case, an error below is displayed.
ERROR: Attributes exposed in aggregate queries must also appear in the group by clause.oracle_style_empty_string
Section titled “oracle_style_empty_string”oracle_style_empty_string is a parameter used to improve compatibility with other DBMS (Database Management Systems); it specifies to process empty string and NULL as the same value. The default is no. If the oracle_style_empty_string parameter is set to no, the character string is processed as a valid string; if it is set to yes, according to each function, the empty string is processed as NULL or NULL is processed as the empty string.
pipes_as_concat
Section titled “pipes_as_concat”pipes_as_concat is a parameter to configure how to handle a double pipe symbol. The default value is yes. If this parameter value is set to yes, a double pipe symbol is handled as a concatenation operator if no, it is handled as the OR operator.
plus_as_concat
Section titled “plus_as_concat”plus_as_concat is a parameter to configure the plus (+) operator, and the default value is yes. It is set in coradb.conf; it cannot be changed with SET SYSTEM PARAMETERS. If a value for this parameter is set to yes, the plus (+) operator will be interpreted as a concatenation operator; if it is set to no, the operator will be interpreted as a numeric operator.
-- plus_as_concat = yesSELECT '1'+'1';'1'+'1'======================'11'SELECT '1'+'a';'1'+'a'======================'1a'-- plus_as_concat = noSELECT '1'+'1';'1'+'1'==========================2.0SELECT '1'+'a';ERROR: Cannot coerce 'a' to type double.require_like_escape_character
Section titled “require_like_escape_character”require_like_escape_character is parameter to configure whether or not to use an ESCAPE character in the LIKE clause, and the default value is no. If a value for this parameter is set to yes and a value for no_backslash_escapes is set to no, backslash (\ will be used as an ESCAPE character in the strings of the LIKE clause, otherwise you should specify an ESCAPE character by using the LIKE ... ESCAPE clause. For details, see LIKE.
return_null_on_function_errors
Section titled “return_null_on_function_errors”return_null_on_function_errors is a parameter used to define actions when errors occur in some SQL functions, and the default value is no. If a value for this parameter is set to yes, NULL is returned; if it is set to no, an error is returned when the error occurs in functions, and the related message is displayed.
The following SQL functions are affected by this system parameter.
Date/time functions
- ADDDATE
- ADDTIME
- DATEDIFF
- DAY
- DAYOFMONTH
- DAYOFWEEK
- DAYOFYEAR
- FROM_DAYS
- FROM_UNIXTIME
- HOUR
- LAST_DAY
- MAKEDATE
- MAKETIME
- MINUTE
- MONTH
- QUARTER
- SEC_TO_TIME
- SECOND
- TIME
- TIME_TO_SEC
- TIMEDIFF
- TO_DAYS
- WEEK
- WEEKDAY
- YEAR
String functions
Numeric functions
- ABS
- ACOS
- ASIN
- ATAN
- ATAN2
- CEIL
- CONV
- COS
- COT
- DEGREES
- EXP
- FLOOR
- LN
- LOG2
- LOG10
- MOD
- POW
- RADIANS
- SIGN
- SIN
- SQRT
- TAN
- TRUNC
- WIDTH_BUCKET
SET SYSTEM PARAMETERS 'return_null_on_function_errors=no';SELECT YEAR('12:34:56');ERROR: Conversion error in time format.SET SYSTEM PARAMETERS 'return_null_on_function_errors=yes';SELECT YEAR('12:34:56');year('12:34:56')======================NULLstring_max_size_bytes
Section titled “string_max_size_bytes”string_max_size_bytes is a parameter to define the maximum byte allowable in string functions or operators. You can set a unit as B, K, M, G or T, which stands for bytes, kilobytes(KB), megabytes(MB), gigabytes(GB) or terabytes(TB) respectively. If you omit the unit, bytes will be applied. The default value is 1,048,576(1M). The minimum value is 64 and the maximum value is 33,554,432(32M).
The functions and operators affected by this parameter are as follows:
- SPACE
- CONCAT
- CONCAT_WS
- '+': Operand of string
- REPEAT
- GROUP_CONCAT: This function is affected not only by string_max_size_bytes parameter, but also by group_concat_max_len.
- INSERT function
unicode_input_normalization
Section titled “unicode_input_normalization”unicode_input_normalization is a parameter to determine whether or not to input unicode stored in system level or not. The default value is no.
In general, unicode text can be stored in "fully composed" or "fully decomposed". When character 'Ä' has 00C4 (if it is encoded in UTF-8, it becomes 2 bytes of C3 84) which is only one code point. In "fully decomposed" mode, it has two code points/characters. It is 0041 (character "A") and 0308(COMBINING DIAERESIS). In case of UTF-8 encoding, it becomes 3 bytes of 41 CC 88.
CoraDB can work with fully composed unicode. For clients which have fully decomposed texts, configure the value of unicode_input_normalization to yes so that it can be converted to fully composed mode; and then it can be reverted to fully decomposed mode. For normalization of unicode encapsulation of CoraDB, compatibility equivalence is not applied. In general, normalization of unicode is not possible to revert after composition, CoraDB supports revert for characters as many as possible, and it applies normalization of unicode encapsulation. The characteristics of CoraDB normalization are as follows:
-
In case of language specific, normalization does not depend on locale.
If one or more locale can be used, this means every CAS/corasql process, not CoraDB server. The unicode_input_normalization system parameter determines whether composition of input codes by normalization in system level. The unicode_output_normalization system parameter determines whether composition of output codes by normalization in system level.
-
Collation and normalization does not have direct relationship.
Even though the value of unicode_input_normalization is no, the string of extensible collation (utf8_de_exp, utf8_jap_exp, utf8_km_exp) is properly sorted fully decomposed mode, it is not intended; it is side-effect of UCA(Unicode Collation Algorithm). The extensible collation is implemented only with fully composed texts.
-
In CoraDB, composition and decomposition for normalization does not work separately.
It is generally used when unicode_input_normalization and unicode_output_normalization are yes. In this case, codes entered from clients are stored in composed mode and output in decomposed mode.
If the application client sends the decomposed text data into CoraDB, let CoraDB deal with the composed code, by setting unicode_input_normalization as yes.
If the application client can deal with the decomposed text data only, let CoraDB always send the decomposed code, by setting unicode_output_normalization as yes.
If the application client knows both of input and output, leave the setting unicode_input_normalization and unicode_output_normalization as no.
For more details, see An overview of globalization.
unicode_output_normalization
Section titled “unicode_output_normalization”unicode_output_normalization is a parameter to determine whether or not to output unicode stored in system level. The default value is no. For details, see the above unicode_input_normalization description.
update_use_attribute_references
Section titled “update_use_attribute_references”update_use_attribute_references is a parameter whether a value X of a column to be updated in an UPDATE statement affects to another column's update which uses X. The default is no.
The below result of an UPDATE statement is dependent on the value of update_use_attribute_references parameter.
CREATE TABLE tbl(a INT, b INT);INSERT INTO tbl values (10, NULL);
UPDATE tbl SET a=1, b=a;If this parameter's value is yes, the updated value of the column "b" will be "1" which is affected by "a=1".
SELECT * FROM tbl;1, 1If this parameter's value is no, the updated value of the column "b" will be "NULL", which is affected by the value of "a" stored in the record, not by "a=1".
SELECT * FROM tbl;1, NULLTimezone parameter
Section titled “Timezone parameter”The following are the parameters related to timezone. The type and the value range for each parameter are as follows:
| Parameter name | Type | Default | Min | Max |
|---|---|---|---|---|
| server_timezone | string | OS timezone | ||
| timezone | string | server_timezone | ||
| tz_leap_second_support | bool | no |
timezone
Section titled “timezone”Specifies a timezone for a session. The default is a value of server_timezone. This value can be specified by a timezone offset (e.g. +01:00, +02) or a timezone region name (e.g. Asia/Seoul). This value can be changed during operating database.
server_timezone
Section titled “server_timezone”Specifies a timezone for a server. The default is a OS timezone. To apply the changed value, database should be restarted. The timezone of operating system is read depending on the operating system and information found in operating system configuration files:
- On Windows, the API tzset() function and tzname[0] variable are used to retrieve an Windows style timezone name. This name is translated into IANA/CoraDB style name using the CoraDB mapping data (the mapping file is %CORADB%\timezones\tzdata\windowsZones.xml).
- On Linux, CoraDB attempts to read and parse the file "/etc/sysconfig/clock". If this file is not available, then the value of link "/etc/localtime" is read and used.
- On AIX, the value of "TZ" operating system environment variable is used.
On all operating systems, if the server_timezone is not specified, and the value for timezone from operating system cannot be read, then "Asia/Seoul" zone is used as server timezone.
tz_leap_second_support
Section titled “tz_leap_second_support”Specifies to support a leap second or not as yes or no. The default is no.
A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC) in order to keep its time of day close to the mean solar time.
To apply the changed value, database should be restarted.
Query plan cache-related parameters
Section titled “Query plan cache-related parameters”The following are parameters related to the query plan cache functionality. The type and value range for each parameter are as follows:
| Parameter name | Type | Default | Min | Max |
|---|---|---|---|---|
| max_plan_cache_entries | int | 1,000 | ||
| max_filter_pred_cache_entries | int | 1,000 |
max_plan_cache_entries
Section titled “max_plan_cache_entries”max_plan_cache_entries is a parameter to configure the maximum number of query plans to be cached in the memory. If the max_plan_cache_entries parameter is configured to -1 or 0, generated query plans are not stored in the memory cache; if it is configured to an integer value equal to 0 or greater than 1, a specified number of query plans are cached in the memory.
The following example shows how to cache up to 1,000 queries.
max_plan_cache_entries=1000max_filter_pred_cache_entries
Section titled “max_filter_pred_cache_entries”max_filter_pred_cache_entries is a parameter used to specify the maximum number of filtered index expressions. The filtered index expressions are stored with them complied and can be immediately used in server. If it is not stored in cache, the process is required which filtered index expressions are fetched from database schema and interpreted.
Query cache-related parameters
Section titled “Query cache-related parameters”The following are the parameters related to the query cache functionality. The type and value range for each parameter are as follows:
| Parameter name | Type | Default | Min | Max |
|---|---|---|---|---|
| max_query_cache_entries | int | 0 | 0 | INT_MAX |
| query_cache_size_in_pages | int | 0 | 0 | INT_MAX |
Both parameters are 0 by default, so the query cache is disabled. If either parameter is 0 or negative, the QUERY_CACHE hint has no effect; set both to positive values to enable it.
max_query_cache_entries
Section titled “max_query_cache_entries”max_query_cache_entries is a parameter to configure the maximum number of query to be cached. When it is greater than 0 (and query_cache_size_in_pages is also greater than 0), up to that many query results are cached.
The following example shows how to cache up to 500 queries.
max_query_cache_entries=500query_cache_size_in_pages
Section titled “query_cache_size_in_pages”query_cache_size_in_pages is a parameter to configure the maximum page of result to be cached. When it is greater than 0 (and max_query_cache_entries is also greater than 0), cached results can use up to that many pages, stored as temporary files.
The following example shows how to cache up to 4,000 pages.
query_cache_size_in_pages=4000