-- Copyright (c) 2003, 2008-2012, Oracle and/or its affiliates. All rights reserved.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; version 2 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

-- DO NOT EDIT THIS FILE. It is generated automatically.

-- To use this file, load its contents into the mysql database. For example,
-- with the mysql client program, process the file like this, where
-- file_name is the name of this file:

--     mysql -u root -p mysql < file_name

set names 'utf8';

set sql_log_bin = 0;

use mysql;
delete from help_topic;
delete from help_category;
delete from help_keyword;
delete from help_relation;

insert into help_category (help_category_id,name,parent_category_id,url) values (1,'Geographic',0,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (2,'Polygon properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (3,'WKT',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (4,'Numeric Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (5,'Plugins',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (6,'MBR',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (7,'Control flow functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (8,'Transactions',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (9,'Help Metadata',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (10,'Account Management',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (11,'Point properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (12,'Encryption Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (13,'LineString properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (14,'Miscellaneous Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (15,'Logical operators',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (16,'Functions and Modifiers for Use with GROUP BY',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (17,'Information Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (18,'Comparison operators',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (19,'Bit Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (20,'Table Maintenance',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (21,'User-Defined Functions',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (22,'Data Types',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (23,'Compound Statements',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (24,'Geometry constructors',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (25,'GeometryCollection properties',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (26,'Administration',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (27,'Data Manipulation',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (28,'Utility',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (29,'Language Structure',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (30,'Geometry relations',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (31,'Date and Time Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (32,'WKB',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (33,'Procedures',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (34,'Geographic Features',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (35,'Contents',0,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (36,'Geometry properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (37,'String Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (38,'Functions',35,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (39,'Data Definition',35,'');

INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (0, 22, 'AUTO\\_INCREMENT FAQ', 'Description\n-----------\n\nHow do I get the last inserted auto_increment value?\n\nUse the LAST_INSERT_ID() function:\n\n``sql\nSELECT LAST_INSERT_ID();\n`\n\nWhat if someone else inserts before I select my id?\n\nLAST_INSERT_ID() is connection specific, so there is no problem from race conditions.\n\nHow do I get the next value to be inserted?\n\nYou don''t. Insert, then find out what you did with LAST_INSERT_ID().\n\nHow do I change what number auto_increment starts with?\n\nRun a query, ALTER TABLE yourTable AUTO_INCREMENT = x; . The next insert will contain x or MAX(autoField) + 1, whichever is higher.\n\nAs an alternative, run INSERT INTO yourTable (autoField) VALUES (x); . The next insert will contain x+1 or MAX(autoField) + 1, whichever is higher.\n\nIssuing TRUNCATE TABLE will delete all the rows in the table, and will reset the auto_increment value to 0 in most cases.\n\nHow do I renumber rows once I deleted some in the middle?\n\nTypically, you don''t want to. Gaps are hardly ever a problem; if your application can''t handle gaps in the sequence, you probably should rethink your application.\n\nCan I do group-wise auto_increment?\n\nYes, if you use the MyISAM engine.\n\nHow do I get the AUTO_INCREMENT value in a BEFORE INSERT trigger?\n\nThis isn''t possible. It''s only available after insert.\n\nHow do I assign two fields the same auto_increment value in one query?\n\nYou can''t, not even with an AFTER INSERT trigger. Insert, then go back and update using LAST_INSERT_ID(). Those two statements could be wrapped into one stored procedure if you wish.\n\nHowever, you can mimic this behavior with a BEFORE INSERT trigger and a second table to store the sequence position:\n\n`sql\nCREATE TABLE sequence (table_name VARCHAR(255), position INT UNSIGNED);\nINSERT INTO sequence VALUES (''testTable'', 0);\nCREATE TABLE testTable (firstAuto INT UNSIGNED, secondAuto INT UNSIGNED);\nDELIMITER //\nCREATE TRIGGER testTable_BI BEFORE INSERT ON testTable FOR EACH ROW BEGIN\n  UPDATE sequence SET position = LAST_INSERT_ID(position + 1) WHERE table_name = ''testTable'';\n  SET NEW.firstAuto = LAST_INSERT_ID();\n  SET NEW.secondAuto = LAST_INSERT_ID();\nEND//\nDELIMITER ;\nINSERT INTO testTable VALUES (NULL, NULL), (NULL, NULL);\nSELECT  FROM testTable;\n\n+-----------+------------+\n| firstAuto | secondAuto |\n+-----------+------------+\n|         1 |          1 |\n|         2 |          2 |\n+-----------+------------+\n`\n\nThe same sequence table can maintain separate sequences for multiple tables (or separate sequences for different fields in the same table) by adding extra rows.\n\nDoes the auto_increment field have to be primary key?\n\nNo, it only has to be indexed. It doesn''t even have to be unique.\n\nHow does InnoDB handle AUTO_INCREMENT?\n\nSee AUTO_INCREMENT handling in InnoDB.\n\nGeneral Information To Read\n\nAUTO_INCREMENT\n\nManual Notes\n\nThere can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. An AUTO_INCREMENT column works properly only if it contains only positive values. Inserting a negative number is regarded as inserting a very large positive number. This is done to avoid precision problems when numbers wrap over from positive to negative and also to ensure that you do not accidentally get an AUTO_INCREMENT column that contains 0.\n\nHow to start a table with a set AUTO_INCREMENT value?\n\n`sql\nCREATE TABLE autoinc_test (\n  h INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, \n  m INT UNSIGNED \n) AUTO_INCREMENT = 100;\n\nINSERT INTO autoinc_test ( m ) VALUES ( 1 );\n\nSELECT  FROM autoinc_test;\n+-----+------+\n| h   | m    |\n+-----+------+\n| 100 |    1 |\n+-----+------+\n``\n\nURL: https://mariadb.com/docs/server/reference/data-types/auto_increment-faq', '', 'https://mariadb.com/docs/server/reference/data-types/auto_increment-faq');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (1, 22, 'AUTO\\_INCREMENT', 'Description\n-----------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new rows. When you insert a new record into the table (or upon adding an AUTO_INCREMENT attribute with the ALTER TABLE statement), and the AUTO_INCREMENT field is NULL or DEFAULT (in the case of an INSERT), automatically be incremented. This also applies to 0, unless the NO_AUTO_VALUE_ON_ZERO SQL_MODE is enabled.\n\nAUTO_INCREMENT columns start from 1 by default. The automatically generated value can never be lower than 0.\n\nEach table can have only one AUTO_INCREMENT column. It must defined as a key (not necessarily the PRIMARY KEY or UNIQUE key). In some storage engines (including the default InnoDB), if the key consists of multiple columns, the AUTO_INCREMENT column must be the first column. Storage engines that permit the column to be placed elsewhere are Aria, MyISAM, MERGE, Spider, TokuDB, BLACKHOLE, FederatedX and Federated.\n\n``sql\nCREATE TABLE animals (\n     id MEDIUMINT NOT NULL AUTO_INCREMENT,\n     name CHAR(30) NOT NULL,\n     PRIMARY KEY (id)\n );\n\nINSERT INTO animals (name) VALUES\n    (''dog''),(''cat''),(''penguin''),\n    (''fox''),(''whale''),(''ostrich'');\n`\n\n`sql\nSELECT  FROM animals;\n+----+---------+\n| id | name    |\n+----+---------+\n|  1 | dog     |\n|  2 | cat     |\n|  3 | penguin |\n|  4 | fox     |\n|  5 | whale   |\n|  6 | ostrich |\n+----+---------+\n`\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\n`sql\nCREATE TABLE t (id SERIAL, c CHAR(1)) ENGINE=InnoDB;\n\nSHOW CREATE TABLE t \\G\n*********************** 1. row ***********************\n       Table: t\nCreate Table: CREATE TABLE t (\n  id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n  c char(1) DEFAULT NULL,\n  UNIQUE KEY id (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n`\n\nSetting or Changing the Auto_Increment Value\n\nYou can use an ALTER TABLE statement to assign a new value to the auto_increment table option, or set the insert_id server system variable to change the next AUTO_INCREMENT value inserted by the current session.\n\nLAST_INSERT_ID() can be used to see the last AUTO_INCREMENT value inserted by the current session.\n\n`sql\nALTER TABLE animals AUTO_INCREMENT=8;\n\nINSERT INTO animals (name) VALUES (''aardvark'');\n\nSELECT  FROM animals;\n+----+-----------+\n| id | name      |\n+----+-----------+\n|  1 | dog       |\n|  2 | cat       |\n|  3 | penguin   |\n|  4 | fox       |\n|  5 | whale     |\n|  6 | ostrich   |\n|  8 | aardvark  |\n+----+-----------+\n\nSET insert_id=12;\n\nINSERT INTO animals (name) VALUES (''gorilla'');\n\nSELECT  FROM animals;\n+----+-----------+\n| id | name      |\n+----+-----------+\n|  1 | dog       |\n|  2 | cat       |\n|  3 | penguin   |\n|  4 | fox       |\n|  5 | whale     |\n|  6 | ostrich   |\n|  8 | aardvark  |\n| 12 | gorilla   |\n+----+-----------+\n`\n\nInnoDB\n\nAUTO_INCREMENT is persistent in InnoDB.\n\nSee also AUTO_INCREMENT Handling in InnoDB.\n\nSetting Explicit Values\n\nIt is possible to specify a value for an AUTO_INCREMENT column. If the key is primary or unique, the value must not already exist in the key.\n\nIf the new value is higher than the current maximum value, the AUTO_INCREMENT value is updated, so the next value will be higher. If the new value is lower than the current maximum value, the AUTO_INCREMENT value remains unchanged.\n\nThe following example demonstrates these behaviors:\n\n`sql\nCREATE TABLE t (id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB;\n\nINSERT INTO t VALUES (NULL);\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n+----+\n\nINSERT INTO t VALUES (10); -- higher value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n| 10 |\n+----+\n\nINSERT INTO t VALUES (2); -- lower value\nINSERT INTO t VALUES (NULL); -- auto value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n|  2 |\n| 10 |\n| 11 |\n+----+\n`\n\nThe ARCHIVE storage engine does not allow to insert a value that is lower than the current maximum.\n\nMissing Values\n\nAn AUTO_INCREMENT column normally has missing values. This happens because if a row is deleted, or an AUTO_INCREMENT value is explicitly updated, old values are never re-used. The REPLACE statement also deletes a row, and its value is wasted. With InnoDB, values can be reserved by a transaction; but if the transaction fails (for example, because of a ROLLBACK) the reserved value will be lost.\n\nThus AUTO_INCREMENT values can be used to sort results in a chronological order, but not to create a numeric sequence.\n\nReplication\n\nTo make master-master or Galera safe to use AUTO_INCREMENT , you should use the system variables auto_increment_increment and auto_increment_offset to generate unique values for each server.\n\n`sql\nSET @@auto_increment_increment=3;\n\nSHOW VARIABLES LIKE ''auto_inc%'';\n+--------------------------+-------+\n| Variable_name            | Value |\n+--------------------------+-------+\n| auto_increment_increment | 3     |\n| auto_increment_offset    | 1     |\n+--------------------------+-------+\n\nCREATE TABLE t (c INT NOT NULL AUTO_INCREMENT PRIMARY KEY);\n\nINSERT INTO t VALUES (NULL), (NULL), (NULL);\n\nSELECT  FROM t;\n+---+\n| c |\n+---+\n| 1 |\n| 4 |\n| 7 |\n+---+\n\nCREATE TABLE t2 (c INT NOT NULL AUTO_INCREMENT PRIMARY KEY);\n\nSET @@auto_increment_offset=2;\n\nSHOW VARIABLES LIKE ''auto_inc%'';\n+--------------------------+-------+\n| Variable_name            | Value |\n+--------------------------+-------+\n| auto_increment_increment | 3     |\n| auto_increment_offset    | 2     |\n+--------------------------+-------+\n\nINSERT INTO t2 VALUES (NULL), (NULL), (NULL);\n\nSELECT  FROM t2;\n+---+\n| c |\n+---+\n| 2 |\n| 5 |\n| 8 |\n+---+\n`\n\nIf auto_increment_offset is larger than auto_increment_increment, the value of auto_increment_offset is ignored, and the offset reverts to the default of 1 instead:\n\n`sql\nSET @@auto_increment_offset=5;\n\nSHOW VARIABLES LIKE ''auto_inc%'';\n+--------------------------+-------+\n| Variable_name            | Value |\n+--------------------------+-------+\n| auto_increment_increment | 3     |\n| auto_increment_offset    | 5     |\n+--------------------------+-------+\n\nCREATE TABLE t3 (c INT NOT NULL AUTO_INCREMENT PRIMARY KEY);\n\nINSERT INTO t3 VALUES (NULL), (NULL), (NULL);\n\nSELECT  FROM t3;\n+---+\n| c |\n+---+\n| 1 |\n| 4 |\n| 5 |\n+---+\n\n+--------------------------+-------+\n| Variable_name            | Value |\n+--------------------------+-------+\n| auto_increment_increment | 3     |\n| auto_increment_offset    | 3     |\n+--------------------------+-------+\n\nINSERT INTO t4 VALUES (NULL), (NULL), (NULL);\n\nSELECT  FROM t4;\n+---+\n| c |\n+---+\n| 3 |\n| 6 |\n| 9 |\n+---+\n`\n\nChanging auto_increment_increment and auto_incremenet_offset when adding a new master to a multi-master setup\n\nThe purpose of auto_increment_increment and auto_increment_offset is to ensure that in a multi-master or multi-source setup, all masters generate unique values for auto_increment fields or for sequences with INCREMENT=0.\n\nIf auto_increment_increment is larger than the current number of masters, then one can configure the new master with the not used auto_increment_offset. The easiest way to add a new master is to stop all MariaDB servers, update auto_increment_increment and auto_increment_offset in the configuration files, and restart.\\\\\n\nThis has to be done if auto_increment_increment is 1. If one has more than one master (auto_increment_increment > 1), there is a way to add more masters with only having to restart one of the masters. The ''trick'' is to configure one of the masters to not use all the values in its current sequence.\n\nThe following example illustrates how to do it. Assume you have two masters, A and B.\n\nIn this case you will have auto_increment_increment=2 for both masters and A would have auto_increment_offset=1 and B would have auto_increment_offset=2. For A, all auto_increment and generated sequence values will be odd.\n\n`sql\n1\n3\n5\n7\n`\n\nFor B, all values will be even:\n\n`sql\n2\n4\n6\n8\n`\n\nSee the Replication section above.\n\nIf we change auto_increment_increment from 2 to 4 in A, it will now generate values from this sequence:\n\n`sql\n1\n5\n9\n13\n`\n\nAs you can see, values 3, 7, 11 are not going to be used.We can get C to use values from this sequence by configuring auto_increment_increment=4 and auto_increment_offset=3.\n\n`sql\n3\n7\n11\n`\n\nIf we would like to add a 4''th master (D), we can do that by changing ''B'' to use auto_increment_increment=4 and then configure D to have auto_increment_increment=4 and auto_increment_offset=4.\n\nNote that when changing the auto_increment_increment or auto_increment_offset on a server, you have to either restart the server or ensure that all current connections are killed. This is needed to force all connections to use the new values.\n\nAlso ensure that, if you want to use the above trick, you always double the value of auto_increment_increment. This is needed to ensure that the sequence used will not conflict with numbers generated by any other master.\n\nCHECK Constraints, DEFAULT Values and Virtual Columns\n\nAUTO_INCREMENT columns are not permitted in CHECK constraints, DEFAULT value expressions and virtual columns.\n\nGenerating Auto_Increment Values When Adding the Attribute\n\n`sql\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (0),(0),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT  FROM t1;\n+---+\n| a |\n+---+\n| 1 |\n| 2 |\n| 3 |\n+---+\n`\n\n`sql\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (5),(0),(8),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT  FROM t1;\n+---+\n| a |\n+---+\n| 5 |\n| 6 |\n| 8 |\n| 9 |\n+---+\n`\n\nIf the NO_AUTO_VALUE_ON_ZERO SQL_MODE is set, zero values will not be automatically incremented:\n\n`sql\nSET SQL_MODE=''no_auto_value_on_zero'';\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (3), (0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT  FROM t1;\n+---+\n| a |\n+---+\n| 0 |\n| 3 |\n+---+\n``\n\nURL: https://mariadb.com/docs/server/reference/data-types/auto_increment', '', 'https://mariadb.com/docs/server/reference/data-types/auto_increment');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (2, 22, 'Data Type Storage Requirements', 'Description\n-----------\n\nThe following tables indicate the approximate data storage requirements for each data type.\n\nNumeric Data Types\n\n| Data Type                                    | Storage Requirement                   |\n| -------------------------------------------- | ------------------------------------- |\n| TINYINT     | 1 byte                                |\n| SMALLINT   | 2 bytes                               |\n| MEDIUMINT | 3 bytes                               |\n| INT             | 4 bytes                               |\n| BIGINT       | 8 bytes                               |\n| FLOAT(p)      | 4 bytes if p <= 24, otherwise 8 bytes |\n| DOUBLE       | 8 bytes                               |\n| DECIMAL     | See table below                       |\n| BIT(M)          | (M+7)/8 bytes                         |\n\nNote that MEDIUMINT columns will require 4 bytes in memory (for example, in InnoDB buffer pool).\n\nDecimal\n\nDecimals are stored using a binary format, with the integer and the fraction stored separately. Each nine-digit multiple requires 4 bytes, followed by a number of bytes for whatever remains, as follows:\n\n| Remaining digits | Storage Requirement |\n| ---------------- | ------------------- |\n| 0                | 0 bytes             |\n| 1                | 1 byte              |\n| 2                | 1 byte              |\n| 3                | 2 bytes             |\n| 4                | 2 bytes             |\n| 5                | 3 bytes             |\n| 6                | 3 bytes             |\n| 7                | 4 bytes             |\n| 8                | 4 bytes             |\n\nString Data Types\n\nIn the descriptions below, M is the declared column length (in characters or in bytes), while len is the actual length in bytes of the value.\n\n| Data Type                                                                                    | Storage Requirement                                                                                        |\n| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| ENUM                                                            | 1 byte for up to 255 enum values, 2 bytes for 256 to 65,535 enum values                                    |\n| CHAR(M)                                                         | M × w bytes, where w is the number of bytes required for the maximum-length character in the character set |\n| BINARY(M)                                                     | M bytes                                                                                                    |\n| VARCHAR(M), VARBINARY(M)   | len + 1 bytes if column is 0 – 255 bytes, len + 2 bytes if column may require more than 255 bytes          |\n| TINYBLOB, TINYTEXT         | len + 1 bytes                                                                                              |\n| BLOB, TEXT                         | len + 2 bytes                                                                                              |\n| MEDIUMBLOB, MEDIUMTEXT | len + 3 bytes                                                                                              |\n| LONGBLOB, LONGTEXT         | len + 4 bytes                                                                                              |\n| XMLTYPE                                                      | len + 4 bytes (same as LONGBLOB)                                                                           |\n| SET                                                    | Given M members of the set, (M+7)/8 bytes, rounded up to 1, 2, 3, 4, or 8 bytes                            |\n| INET6                                                          | 16 bytes                                                                                                   |\n| UUID                                                  | 16 bytes                                                                                                   |\n\nNote: Introduced in MariaDB 12.3, the XMLTYPE data type has a maximum storage capacity of 4GB, similar to LONGBLOB_._\n\nIn some character sets, not all characters use the same number of bytes. utf8 encodes characters with one to three bytes per character, while utf8mb4 requires one to four bytes per character.\n\nWhen using field the COMPRESSED attribute, 1 byte is reserved for metadata. For example, VARCHAR(255) will use +2 bytes instead of +1.\n\nURL: https://mariadb.com/docs/server/reference/data-types/data-type-storage-requirements', '', 'https://mariadb.com/docs/server/reference/data-types/data-type-storage-requirements');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (3, 22, 'DATE', 'Syntax\n------\n\nDATE\n\nDescription\n-----------\n\nA date. The supported range is ''1000-01-01'' to ''9999-12-31''. MariaDB displays DATE values in ''YYYY-MM-DD'' format, but can be assigned dates in looser formats, including strings or numbers, as long as they make sense. These include a short year, YY-MM-DD, no delimiters, YYMMDD, or any other acceptable delimiter, for example YYYY/MM/DD. For details, see date and time literals.\n\n''0000-00-00'' is a permitted special value (zero-date), unless the NO_ZERO_DATE SQL_MODE is used. Also, individual components of a date can be set to 0 (for example: ''2015-00-12''), unless the NO_ZERO_IN_DATE SQL_MODE is used. In many cases, the result of en expression involving a zero-date, or a date with zero-parts, is NULL. If the ALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is in the range between 1 and 31, the date does not produce any error, even for months that have less than 31 days.\n\nOracle Mode\n\nIn Oracle mode, DATE with a time portion is a synonym for DATETIME. See also mariadb_schema.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATE);\n\nINSERT INTO t1 VALUES ("2010-01-12"), ("2011-2-28"), (''120314''),(''130421'');\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 2010-01-12 |\n| 2011-02-28 |\n| 2012-03-14 |\n| 2013-04-21 |\n+------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/date', '', 'https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/date');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (4, 22, 'DATETIME', 'Syntax\n------\n\nDATETIME [(microsecond precision)]\n\nDescription\n-----------\n\nA date and time combination.\n\nMariaDB displays DATETIME values in ''YYYY-MM-DD HH:MM:SS.ffffff'' format, but allows assignment of values to DATETIME columns using either strings or numbers. For details, see date and time literals.\n\nDATETIME columns also accept CURRENT_TIMESTAMP as the default value.\n\nThe --mysql56-temporal-format option, on by default, allows MariaDB to store DATETME values using the same low-level format MySQL 5.6 uses. For more information, see Internal Format, below.\n\nFor storage requirements, see Data Type Storage Requirements.\n\nSupported Values\n\nMariaDB stores values that use the DATETIME data type in a format that supports values between 1000-01-01 00:00:00.000000 and 9999-12-31 23:59:59.999999.\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no microsecond precision is specified, then 0 is used by default.\n\nMariaDB also supports ''0000-00-00'' as a special _zero-date_ value, unless NO_ZERO_DATE is specified in the SQL_MODE. Similarly, individual components of a date can be set to 0 (for example: ''2015-00-12''), unless NO_ZERO_IN_DATE is specified in the SQL_MODE. In many cases, the result of en expression involving a zero-date, or a date with zero-parts, is NULL. If the ALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is in the range between 1 and 31, the date does not produce any error, even for months that have less than 31 days.\n\nOracle Mode\n\nIn Oracle mode, DATE with a time portion is a synonym for DATETIME. See also mariadb_schema.\n\nInternal Format\n\nA new temporal format was introduced from MySQL 5.6 that alters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels. These changes allow these temporal data types to have fractional parts and negative values. You can disable this feature using the mysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of MariaDB or that were created while the mysql56_temporal_format system variable was disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format, execute an ALTER TABLE... MODIFY COLUMN statement that changes the column to the _same_ data type. This change may be needed if you want to export the table''s tablespace and import it onto a server that has mysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a DATETIME column in your table:\n\n``sql\nSHOW VARIABLES LIKE ''mysql56_temporal_format'';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col DATETIME;\n`\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the older temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data types that you want to switch over to the new format, make sure the system variable is enabled, then perform a dump and restore using mysqldump. The columns using relevant temporal data types are restored using the new temporal format.\n\nColumns with old temporal formats are marked with a / mariadb-5.3 / comment in the output of SHOW CREATE TABLE, SHOW COLUMNS, DESCRIBE statements, as well as in the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS Table.\n\n`sql\nSHOW CREATE TABLE mariadb5312_datetime\\G\n************************ 1. row ***********************\n       Table: mariadb5312_datetime\nCreate Table: CREATE TABLE mariadb5312_datetime (\n  dt0 datetime / mariadb-5.3 / DEFAULT NULL,\n  dt6 datetime(6) / mariadb-5.3 / DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n``\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\n\nINSERT INTO t1 VALUES ("2011-03-11"), ("2012-04-19 13:08:22"),\n ("2013-07-18 13:44:22.123456");\n\nSELECT  FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-03-11 00:00:00 |\n| 2012-04-19 13:08:22 |\n| 2013-07-18 13:44:22 |\n+---------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/datetime', '', 'https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/datetime');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (5, 22, 'SQL\\_TSI\\_YEAR', 'Description\n-----------\n\nSee YEAR.\n\nExamples\n--------\n\nCREATE TABLE sql_tsi_year_example (\n  example SQL_TSI_YEAR\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/sql_tsi_year', '', 'https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/sql_tsi_year');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (6, 22, 'TIME', 'Syntax\n------\n\nTIME [(<microsecond precision>)]\n\nDescription\n-----------\n\nA time. The range is ''-838:59:59.999999'' to ''838:59:59.999999''. Microsecond precision can be from 0-6; if not specified 0 is used.\n\nMariaDB displays TIME values in ''HH:MM:SS.ssssss'' format, but allows assignment of times in looser formats, including ''D HH:MM:SS'', ''HH:MM:SS'', ''HH:MM'', ''D HH:MM'', ''D HH'', ''SS'', or ''HHMMSS'', as well as permitting dropping of any leading zeros when a delimiter is provided, for example ''3:9:10''. For details, see date and time literals.\n\nThe --mysql56-temporal-format option, on by default, allows MariaDB to store TIME values using the same low-level format MySQL 5.6 uses.\n\nInternal Format\n\nA new temporal format was introduced from MySQL 5.6 that alters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels. These changes allow these temporal data types to have fractional parts and negative values. You can disable this feature using the mysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of MariaDB or that were created while the mysql56_temporal_format system variable was disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format, execute an ALTER TABLE... MODIFY COLUMN statement that changes the column to the _same_ data type. This change may be needed if you want to export the table''s tablespace and import it onto a server that has mysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIME column in your table:\n\n``sql\nSHOW VARIABLES LIKE ''mysql56_temporal_format'';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIME;\n`\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the older temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data types that you want to switch over to the new format, make sure the system variable is enabled, then perform a dump and restore using mariadb-dump. The columns using relevant temporal data types are restored using the new temporal format.\n\nColumns with old temporal formats are marked with a / mariadb-5.3 / comment in the output of SHOW CREATE TABLE, SHOW COLUMNS, DESCRIBE statements, as well as in the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS Table.\n\n`sql\nSHOW CREATE TABLE mariadb5312_time\\G\n************************ 1. row ***********************\n       Table: mariadb5312_time\nCreate Table: CREATE TABLE mariadb5312_time (\n  t0 time / mariadb-5.3 / DEFAULT NULL,\n  t6 time(6) / mariadb-5.3 / DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n``\n\nColumns with the current format are not marked with a comment.\n\nExamples\n--------\n\nINSERT INTO time VALUES (''90:00:00''), (''800:00:00''), (800), (22), (151413), (''9:6:3''), (''12 09'');\n\nSELECT  FROM time;\n+-----------+\n| t         |\n+-----------+\n| 90:00:00  |\n| 800:00:00 |\n| 00:08:00  |\n| 00:00:22  |\n| 15:14:13  |\n| 09:06:03  |\n| 297:00:00 |\n+-----------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/time', '', 'https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/time');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (7, 22, 'TIMESTAMP', 'Syntax\n------\n\nTIMESTAMP [(<microsecond precision)]\n\nDescription\n-----------\n\nA timestamp in the format YYYY-MM-DD HH:MM:SS.ffffff.\n\nThe timestamp field is generally used to define at which moment in time a row was added or updated and by default will automatically be assigned the current datetime when a record is inserted or updated. The automatic properties only apply to the first TIMESTAMP in the record; subsequent TIMESTAMP columns will not be changed.\n\nMariaDB includes the --mysql56-temporal-format option, on by default, which allows MariaDB to store TIMESTAMP values using the same low-level format MySQL 5.6 uses.\n\nFor more information, see Internal Format.\n\nSupported Values\n\nMariaDB stores values that use the TIMESTAMP data type as the number of seconds since ''1970-01-01 00:00:00'' (UTC). This means that the TIMESTAMP data type can hold values between ''1970-01-01 00:00:01'' (UTC) and ''2106-02-07 06:28:15 UTC''.\n\nMariaDB stores values that use the TIMESTAMP data type as the number of seconds since ''1970-01-01 00:00:00'' (UTC). This means that the TIMESTAMP data type can hold values between ''1970-01-01 00:00:01'' (UTC) and ''2038-01-19 03:14:07'' (UTC).\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no microsecond precision is specified, then 0 is used by default.\n\nAutomatic Values\n\nMariaDB has special behavior for the first column that uses the TIMESTAMP data type in a specific table when the system variable explicit_defaults_for_timestamp is not set (which was the default until MariaDB 10.10). For the first column that uses the TIMESTAMP data type in a specific table, MariaDB automatically assigns the following properties to the column:\n\n DEFAULT CURRENT_TIMESTAMP\n ON UPDATE CURRENT_TIMESTAMP\n\nThis means that if the column is not explicitly assigned a value in an INSERT or UPDATE query, then MariaDB will automatically initialize the column''s value with the current date and time.\n\nThis automatic initialization for INSERT and UPDATE queries can also be explicitly enabled for a column that uses the TIMESTAMP data type by specifying the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses for the column. In these clauses, any synonym of CURRENT_TIMESTAMP is accepted, including CURRENT_TIMESTAMP(), NOW(), LOCALTIME, LOCALTIME(), LOCALTIMESTAMP, and LOCALTIMESTAMP().\n\nThis automatic initialization for INSERT queries can also be explicitly disabled for a column that uses the TIMESTAMP data type by specifying a constant DEFAULT value. For example, DEFAULT 0.\n\nThis automatic initialization for UPDATE queries can also be explicitly disabled for a column that uses the TIMESTAMP data type by specifying a DEFAULT clause for the column, but no ON UPDATE clause. If a DEFAULT clause is explicitly specified for a column that uses the TIMESTAMP data type, but an ON UPDATE clause is not specified for the column, then the timestamp value will not automatically change when an UPDATE statement is executed.\n\nMariaDB also has special behavior if NULL is assigned to column that uses the TIMESTAMP data type. If the column is assigned the NULL value in an INSERT or UPDATE query, then MariaDB will automatically initialize the column''s value with the current date and time. For details, see NULL values in MariaDB.\n\nThis automatic initialization for NULL values can also be explicitly disabled for a column that uses the TIMESTAMP data type by specifying the NULL attribute for the column. In this case, if the column''s value is set to NULL, then the column''s value will actually be set to NULL.\n\nTime Zones\n\nIf a column uses the TIMESTAMP data type, then any inserted values are converted from the session''s time zone to Coordinated Universal Time (UTC) when stored, and converted back to the session''s time zone when retrieved.\n\nMariaDB validates TIMESTAMP literals against the session''s time zone. For example, if a specific time range never occurred in a specific time zone due to daylight savings time, then TIMESTAMP values within that range would be invalid for that time zone.\n\nMariaDB does not store any time zone identifier with the value of the TIMESTAMP data type. See MDEV-10018 for more information.\n\nMariaDB does not support time zone literals that contain time zone identifiers. See MDEV-11829 for more information.\n\nLimitations\n\n Because the TIMESTAMP value is stored as Epoch Seconds, the timestamp value ''1970-01-01 00:00:00'' (UTC) is reserved since the second #0 is used to represent ''0000-00-00 00:00:00''.\n\nSQL_MODE=MAXDB\n\nIf the SQL_MODE is set to MAXDB, TIMESTAMP fields will be silently converted to DATETIME.\n\nInternal Format\n\nA temporal format was introduced from MySQL 5.6 that alters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels. These changes allow these temporal data types to have fractional parts and negative values. You can disable this feature using the mysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of MariaDB or that were created while the mysql56_temporal_format system variable was disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format, execute an ALTER TABLE... MODIFY COLUMN statement that changes the column to the _same_ data type. This change may be needed if you want to export the table''s tablespace and import it onto a server that has mysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIMESTAMP column in your table:\n\n``sql\nSHOW VARIABLES LIKE ''mysql56_temporal_format'';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIMESTAMP;\n`\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the older temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data types that you want to switch over to the new format, make sure the system variable is enabled, then perform a dump and restore using mariadb-dump. The columns using relevant temporal data types are restored using the new temporal format.\n\nColumns with old temporal formats are marked with a / mariadb-5.3 / comment in the output of SHOW CREATE TABLE, SHOW COLUMNS, DESCRIBE statements, as well as in the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS Table.\n\nColumns with old temporal formats are not marked with a / mariadb-5.3 / comment in the output of SHOW CREATE TABLE, SHOW COLUMNS, DESCRIBE statements, as well as in the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS Table.\n\n`sql\nSHOW CREATE TABLE mariadb5312_timestamp\\G\n*********************** 1. row ***********************\n       Table: mariadb5312_timestamp\nCreate Table: CREATE TABLE mariadb5312_timestamp (\n  ts0 timestamp / mariadb-5.3 / NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n  ts6 timestamp(6) / mariadb-5.3 / NOT NULL DEFAULT ''0000-00-00 00:00:00.000000''\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n``\n\nExamples\n--------\n\nCREATE TABLE t (id INT, ts TIMESTAMP);\n\nDESC t;\n+-------+-----------+------+-----+-------------------+-----------------------------+\n| Field | Type      | Null | Key | Default           | Extra                       |\n+-------+-----------+------+-----+-------------------+-----------------------------+\n| id    | int(11)   | YES  |     | NULL              |                             |\n| ts    | timestamp | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |\n+-------+-----------+------+-----+-------------------+-----------------------------+\n\nINSERT INTO t(id)  VALUES (1),(2);\n\nSELECT  FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    1 | 2013-07-22 12:50:05 |\n|    2 | 2013-07-22 12:50:05 |\n+------+---------------------+\n\nINSERT INTO t  VALUES (3,NULL),(4,''2001-07-22 12:12:12'');\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    1 | 2013-07-22 12:50:05 |\n|    2 | 2013-07-22 12:50:05 |\n|    3 | 2013-07-22 12:51:56 |\n|    4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/timestamp', '', 'https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/timestamp');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (8, 22, 'YEAR Data Type', 'Syntax\n------\n\nYEAR[(4)]\n\nDescription\n-----------\n\nA year in four-digit format. The two-digit format, while supported, is error-prone and deprecated since 2012.\n\nIn four-digit format, the allowable values are 1901 to 2155, and 0000. In two-digit format, the allowable values are 70 to 69, representing years from 1970 to 2069. MariaDB displays YEAR values in YYYY format, but allows you to assign values to YEAR columns using either strings or numbers.\n\nInserting numeric zero has a different result for YEAR(4) and YEAR(2). For YEAR(2), the value 00 reflects the year 2000. For YEAR(4), the value 0000 reflects the year zero. This only applies to numeric zero. String zero always reflects the year 2000.\n\nExamples\n--------\n\nCREATE TABLE y(y YEAR);\n\nINSERT INTO y VALUES (1990),(''2012'');\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/year-data-type', '', 'https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/year-data-type');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (9, 22, 'NULL Values', 'Description\n-----------\n\nNULL represents an unknown value. It is _not_ an empty string (by default), or a zero value. These are all valid values, and are not NULL values.\n\nWhen a table is created or the format altered, columns can be specified as accepting NULL values, or not accepting them, with the NULL and NOT NULL clauses respectively.\n\nFor example, a customer table could contain dates of birth. For some customers, this information is unknown, so the value could be NULL.\n\nThe same system could allocate a customer ID for each customer record, and in this case a NULL value would not be permitted.\n\n``sql\nCREATE TABLE customer (\n id INT NOT NULL, \n date_of_birth DATE NULL\n...\n)\n`\n\nUser-defined variables are NULL until a value is explicitly assigned.\n\nStored routines parameters and local variables can always be set to NULL. If no DEFAULT value is specified for a local variable, its initial value will be NULL. If no value is assigned to an OUT parameter in a stored procedure, NULL is assigned at the end of the procedure.\n\nSyntax\n\nThe case of NULL is not relevant. (uppercase) is an alias for NULL.\n\nThe IS operator accepts UNKNOWN as an alias for NULL, which is meant for boolean contexts.\n\nComparison Operators\n\nNULL values cannot be used with most comparison operators. For example, =, >, >=, <=, <, or != cannot be used, as any comparison with a NULL always returns a NULL value, never true (1) or false (0).\n\n`sql\nSELECT NULL = NULL;\n+-------------+\n| NULL = NULL |\n+-------------+\n|        NULL |\n+-------------+\n\nSELECT 99 = NULL;\n+-----------+\n| 99 = NULL |\n+-----------+\n|      NULL |\n+-----------+\n`\n\nTo overcome this, certain operators are specifically designed for use with NULL values. To cater for testing equality between two values that may contain NULL values, there''s <=>, NULL-safe equal.\n\n`sql\nSELECT 99 <=> NULL, NULL <=> NULL;\n+-------------+---------------+\n| 99 <=> NULL | NULL <=> NULL |\n+-------------+---------------+\n|           0 |             1 |\n+-------------+---------------+\n`\n\nOther operators for working with NULL values include IS NULL and IS NOT NULL, ISNULL (for testing an expression) and COALESCE (for returning the first non-NULL parameter).\n\nOrdering\n\nWhen you order by a field that may contain NULL values, any NULL values are considered to have the lowest value. So ordering in DESC order will see the NULL values appearing last. To force NULL values to be regarded as highest values, one can add another column which has a higher value when the main field is NULL. Example:\n\n`sql\nSELECT col1 FROM tab ORDER BY ISNULL(col1), col1;\n`\n\nDescending order, with NULL values first:\n\n`sql\nSELECT col1 FROM tab ORDER BY IF(col1 IS NULL, 0, 1), col1 DESC;\n`\n\nAll NULL values are also regarded as equivalent for the purposes of the DISTINCT and GROUP BY clauses.\n\nFunctions\n\nIn most cases, functions will return NULL if any of the parameters are NULL. There are also functions specifically for handling NULL values. These include IFNULL(), NULLIF() and COALESCE().\n\n`sql\nSELECT IFNULL(1,0); \n+-------------+\n| IFNULL(1,0) |\n+-------------+\n|           1 |\n+-------------+\n\nSELECT IFNULL(NULL,10);\n+-----------------+\n| IFNULL(NULL,10) |\n+-----------------+\n|              10 |\n+-----------------+\n\nSELECT COALESCE(NULL,NULL,1);\n+-----------------------+\n| COALESCE(NULL,NULL,1) |\n+-----------------------+\n|                     1 |\n+-----------------------+\n`\n\nAggregate functions, such as SUM and AVG ignore NULL values.\n\n`sql\nCREATE TABLE t(x INT);\n\nINSERT INTO t VALUES (1),(9),(NULL);\n\nSELECT SUM(x) FROM t;\n+--------+\n| SUM(x) |\n+--------+\n|     10 |\n+--------+\n\nSELECT AVG(x) FROM t;\n+--------+\n| AVG(x) |\n+--------+\n| 5.0000 |\n+--------+\n`\n\nThe one exception is COUNT(\\), which counts rows, and doesn''t look at whether a value is NULL or not. Compare for example, COUNT(x), which ignores the NULL, and COUNT(), which counts it:\n\n`sql\nSELECT COUNT(x) FROM t;\n+----------+\n| COUNT(x) |\n+----------+\n|        2 |\n+----------+\n\nSELECT COUNT() FROM t;\n+----------+\n| COUNT() |\n+----------+\n|        3 |\n+----------+\n`\n\nAUTO_INCREMENT, TIMESTAMP and Virtual Columns\n\nMariaDB handles NULL values in a special way if the field is an AUTO_INCREMENT, a TIMESTAMP or a virtual column. Inserting a NULL value into a numeric AUTO_INCREMENT column will result in the next number in the auto increment sequence being inserted instead. This technique is frequently used with AUTO_INCREMENT fields, which are left to take care of themselves.\n\n`sql\nCREATE TABLE t2(id INT PRIMARY KEY AUTO_INCREMENT, letter CHAR(1));\n\nINSERT INTO t2(letter) VALUES (''a''),(''b'');\n\nSELECT  FROM t2;\n+----+--------+\n| id | letter |\n+----+--------+\n|  1 | a      |\n|  2 | b      |\n+----+--------+\n`\n\nSimilarly, if a NULL value is assigned to a TIMESTAMP field, the current date and time is assigned instead.\n\n`sql\nCREATE TABLE t3 (x INT, ts TIMESTAMP);\n\nINSERT INTO t3(x) VALUES (1),(2);\n`\n\nAfter a pause:\n\n`sql\nINSERT INTO t3(x) VALUES (3);\n\nSELECT FROM t3;\n+------+---------------------+\n| x    | ts                  |\n+------+---------------------+\n|    1 | 2013-09-05 10:14:18 |\n|    2 | 2013-09-05 10:14:18 |\n|    3 | 2013-09-05 10:14:29 |\n+------+---------------------+\n`\n\nIf a NULL is assigned to a VIRTUAL or PERSISTENT column, the default value is assigned instead.\n\n`sql\nCREATE TABLE virt (c INT, v INT AS (c+10) PERSISTENT) ENGINE=InnoDB;\n\nINSERT INTO virt VALUES (1, NULL);\n\nSELECT c, v FROM virt;\n+------+------+\n| c    | v    |\n+------+------+\n|    1 |   11 |\n+------+------+\n`\n\nIn all these special cases, NULL is equivalent to the DEFAULT keyword.\n\nInserting\n\nIf a NULL value is single-row inserted into a column declared as NOT NULL, an error will be returned. However, if the SQL mode is not strict (strict is the default), if a NULL value is multi-row inserted into a column declared as NOT NULL, the implicit default for the column type will be inserted (and NOT` the default value in the table definition). The implicit defaults are an empty string for string types, and the zero value for numeric, date and time types.\n\nBy default, both cases will result in an error.\n\nExamples\n--------\n\nCREATE TABLE nulltest (\n  a INT(11), \n  x VARCHAR(10) NOT NULL DEFAULT ''a'', \n  y INT(11) NOT NULL DEFAULT 23\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/null-values', '', 'https://mariadb.com/docs/server/reference/data-types/null-values');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (10, 22, 'BIGINT', 'Syntax\n------\n\nBIGINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA large integer. The signed range is -9223372036854775808 to9223372036854775807. The unsigned range is 0 to18446744073709551615.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so that the BIGINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will automatically become UNSIGNED.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nSERIAL is an alias for:\n\n``sql\nBIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE\n`\n\nINT8 is a synonym for BIGINT`.\n\nExamples\n--------\n\nCREATE TABLE bigints (a BIGINT,b BIGINT UNSIGNED,c BIGINT ZEROFILL);\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column ''b'' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column ''c'' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES (9223372036854775808,9223372036854775808,9223372036854775808);\nERROR 1264 (22003): Out of range value for column ''a'' at row 1\n\nINSERT INTO bigints VALUES (9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a                   | b                   | c                    |\n+---------------------+---------------------+----------------------+\n|                 -10 |                  10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bigint', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bigint');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (11, 22, 'BIT', 'Syntax\n------\n\nBIT[(M)]\n\nDescription\n-----------\n\nA bit-field type. M indicates the number of bits per value, from 1 to64. The default is 1 if M is omitted.\n\nBit values can be inserted with b''value'' notation, where value is the bit value in 0''s and 1''s.\n\nBit fields are automatically zero-padded from the left to the full length of the bit, so for example in a BIT(4) field, ''10'' is equivalent to ''0010''.\n\nBits are returned as binary, so to display them, either add 0, or use a function such as HEX, OCT or BIN to convert them.\n\nExamples\n--------\n\nCREATE TABLE bit_example (\n  description VARCHAR(20),\n  b1 BIT,\n  b4 BIT(4),\n  b16 BIT(16)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bit', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bit');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (12, 22, 'BOOL', 'Description\n-----------\n\nSee TINYINT.\n\nExamples\n--------\n\nCREATE TABLE bool_example (\n  example BOOL\n) DEFAULT CHARSET=latin1;\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bool', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bool');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (13, 22, 'BOOLEAN', 'Syntax\n------\n\nBOOL, BOOLEAN\n\nDescription\n-----------\n\nThese types are synonyms for TINYINT(1). A value of zero is considered false. Non-zero values are considered true.\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0. See Boolean Literals, as well as the IS operator for testing values against a boolean.\n\nExamples\n--------\n\nCREATE TABLE boolean_example (\n  example BOOLEAN\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/boolean', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/boolean');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (14, 22, 'DEC, NUMERIC, FIXED', 'Syntax\n------\n\nDEC[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nNUMERIC[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nFIXED[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available for compatibility with other database systems.\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/dec-numeric-fixed', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/dec-numeric-fixed');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (15, 22, 'DECIMAL', 'Syntax\n------\n\nDECIMAL[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA packed "exact" fixed-point number. M is the total number of digits (the precision), and D is the number of digits after the decimal point (the scale).\n\n The decimal point and (for negative numbers) the "-" sign are not counted in M.\n If D is 0, values have no decimal point or fractional part, and on INSERT, the value will be rounded to the nearest DECIMAL.\n The maximum number of digits (M) for DECIMAL is 65.\n The maximum number of supported decimals (D) is 30 before MariadB 10.2.1 and 38 afterwards.\n If D is omitted, the default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of digits specified by M.\n\nAll basic calculations (+, -, \\, /) with DECIMAL columns are done with a precision of 65 digits.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nDEC, NUMERIC, and FIXED are synonyms, as well as NUMBER in Oracle mode.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DECIMAL UNSIGNED ZEROFILL);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4.0),(5.2),(5.7);\nQuery OK, 6 rows affected, 2 warnings (0.16 sec)\nRecords: 6  Duplicates: 0  Warnings: 2\n\nNote (sql 1265): Data truncated for column ''d'' at row 5\nNote (sql 1265): Data truncated for column ''d'' at row 6\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n+------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/decimal', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/decimal');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (16, 22, 'DOUBLE PRECISION', 'Syntax\n------\n\nDOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nREAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nREAL and DOUBLE PRECISION are synonyms for DOUBLE.\n\nException: If the REAL_AS_FLOAT SQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nExamples\n--------\n\nCREATE TABLE double_precision_example (\n  example DOUBLE PRECISION\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/double-precision', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/double-precision');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (17, 22, 'DOUBLE', 'Syntax\n------\n\nDOUBLE[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nDOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nREAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size (double-precision) floating-point number (see FLOAT for a single-precision floating-point number). Allowable values are:\n\n -1.7976931348623157E+308 to -2.2250738585072014E-308\n 0\n 2.2250738585072014E-308 to 1.7976931348623157E+308\n\nThese are the theoretical limits, based on the IEEE standard. The actual range might be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the decimal point. If M and D are omitted, values are stored to the limits allowed by the hardware. A double-precision floating-point number is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of digits specified by M.\n\nREAL and DOUBLE PRECISION are synonyms, unless the REAL_AS_FLOAT SQL mode is enabled, in which case REAL is a synonym for FLOAT rather than DOUBLE.\n\nSee Floating Point Accuracy for issues when using floating-point numbers.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DOUBLE(5,0) zerofill);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\n\nSELECT  FROM t1;\n+-------+\n| d     |\n+-------+\n| 00001 |\n| 00002 |\n| 00003 |\n| 00004 |\n+-------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/double', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/double');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (18, 22, 'FIXED', 'Description\n-----------\n\nSee DECIMAL.\n\nExamples\n--------\n\nCREATE TABLE fixed_example (\n  example FIXED\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/fixed', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/fixed');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (19, 22, 'FLOAT', 'Syntax\n------\n\nFLOAT[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small (single-precision) floating-point number (see DOUBLE for a regular-size floating point number). Allowable values are:\n\n -3.402823466E+38 to -1.175494351E-38\n 0\n* 1.175494351E-38 to 3.402823466E+38.\n\nThese are the theoretical limits, based on the IEEE standard. The actual range might be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the decimal point. If M and D are omitted, values are stored to the limits allowed by the hardware. A single-precision floating-point number is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all calculations in MariaDB are done with double precision. See Floating Point Accuracy.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE float_signed_example (\n  description VARCHAR(20),\n  example FLOAT,\n  sz6_2 FLOAT(6,2),\n  sz20_19 FLOAT(20,19) SIGNED\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (20, 22, 'FLOAT4', 'Description\n-----------\n\nSee FLOAT.\n\nExamples\n--------\n\nCREATE TABLE float4_example (\n  example FLOAT4\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float4', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float4');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (21, 22, 'FLOAT8', 'Description\n-----------\n\nSee DOUBLE.\n\nExamples\n--------\n\nCREATE TABLE float8_example (\n  example FLOAT8\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float8', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float8');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (22, 22, 'Floating-point Accuracy', 'Description\n-----------\n\nDue to their nature, not all floating-point numbers can be stored with exact precision. Hardware architecture, the CPU or even the compiler version and optimization level may affect the precision.\n\nIf you are comparing DOUBLEs or FLOATs with numeric decimals, it is not safe to use the equality operator.\n\nSometimes, changing a floating-point number from single-precision (FLOAT) to double-precision (DOUBLE) will fix the problem.\n\nExamples\n--------\n\nCREATE TABLE fpn (id INT, f1 FLOAT, f2 DOUBLE, f3 DECIMAL (10,3));\nINSERT INTO fpn VALUES (1,2,2,2),(2,0.1,0.1,0.1);\n\nSELECT  FROM fpn WHERE f1f1 = f2*f2;\n+------+------+------+-------+\n| id   | f1   | f2   | f3    |\n+------+------+------+-------+\n|    1 |    2 |    2 | 2.000 |\n+------+------+------+-------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/floating-point-accuracy', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/floating-point-accuracy');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (23, 22, 'INT', 'Syntax\n------\n\nINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\nINTEGER[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size integer. When marked UNSIGNED, it ranges from 0 to 4294967295, otherwise its range is -2147483648 to 2147483647 (SIGNED is the default). If a column has been set to ZEROFILL, all values will be prepended by zeros so that the INT value contains a number of M digits. INTEGER is a synonym for INT.\n\nNote: If the ZEROFILL attribute has been specified, the column will automatically become UNSIGNED.\n\nINT4 is a synonym for INT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE ints (a INT,b INT UNSIGNED,c INT ZEROFILL);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (24, 22, 'INT1', 'Description\n-----------\n\nINT1 is a synonym for TINYINT.\n\n``sql\nCREATE TABLE t1 (x INT1);\n\nDESC t1;\n+-------+------------+------+-----+---------+-------+\n| Field | Type       | Null | Key | Default | Extra |\n+-------+------------+------+-----+---------+-------+\n| x     | tinyint(4) | YES  |     | NULL    |       |\n+-------+------------+------+-----+---------+-------+\n``\n\nExamples\n--------\n\nCREATE TABLE int1_example (\n  example INT1\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int1', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int1');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (25, 22, 'INT2', 'Description\n-----------\n\nINT2 is a synonym for SMALLINT.\n\n``sql\nCREATE TABLE t1 (x INT2);\n\nDESC t1;\n+-------+-------------+------+-----+---------+-------+\n| Field | Type        | Null | Key | Default | Extra |\n+-------+-------------+------+-----+---------+-------+\n| x     | smallint(6) | YES  |     | NULL    |       |\n+-------+-------------+------+-----+---------+-------+\n``\n\nExamples\n--------\n\nCREATE TABLE int2_example (\n  example INT2\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int2', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int2');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (26, 22, 'INT3', 'Description\n-----------\n\nINT3 is a synonym for MEDIUMINT.\n\n``sql\nCREATE TABLE t1 (x INT3);\n\nDESC t1;\n+-------+--------------+------+-----+---------+-------+\n| Field | Type         | Null | Key | Default | Extra |\n+-------+--------------+------+-----+---------+-------+\n| x     | mediumint(9) | YES  |     | NULL    |       |\n+-------+--------------+------+-----+---------+-------+\n``\n\nExamples\n--------\n\nCREATE TABLE int3_example (\n  example INT3\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int3', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int3');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (27, 22, 'INT4', 'Description\n-----------\n\nINT4 is a synonym for INT.\n\n``sql\nCREATE TABLE t1 (x INT4);\n\nDESC t1;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| x     | int(11) | YES  |     | NULL    |       |\n+-------+---------+------+-----+---------+-------+\n``\n\nExamples\n--------\n\nCREATE TABLE int4_example (\n  example INT4\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int4', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int4');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (28, 22, 'INT8', 'Description\n-----------\n\nINT8 is a synonym for BIGINT.\n\n``sql\nCREATE TABLE t1 (x INT8);\n\nDESC t1;\n+-------+------------+------+-----+---------+-------+\n| Field | Type       | Null | Key | Default | Extra |\n+-------+------------+------+-----+---------+-------+\n| x     | bigint(20) | YES  |     | NULL    |       |\n+-------+------------+------+-----+---------+-------+\n``\n\nExamples\n--------\n\nCREATE TABLE int8_example (\n  example INT8\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int8', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int8');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (29, 22, 'INTEGER', 'Syntax\n------\n\nINTEGER[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nThis type is a synonym for INT.\n\nExamples\n--------\n\nCREATE TABLE integer_example (\n  example INTEGER\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/integer', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/integer');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (30, 22, 'MEDIUMINT', 'Syntax\n------\n\nMEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.\n\nZEROFILL pads the integer with zeroes and assumes UNSIGNED (even if UNSIGNED is not specified).\n\nINT3 is a synonym for MEDIUMINT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c MEDIUMINT ZEROFILL);\n\nDESCRIBE mediumints;\n+-------+--------------------------------+------+-----+---------+-------+\n| Field | Type                           | Null | Key | Default | Extra |\n+-------+--------------------------------+------+-----+---------+-------+\n| a     | mediumint(9)                   | YES  |     | NULL    |       |\n| b     | mediumint(8) unsigned          | YES  |     | NULL    |       |\n| c     | mediumint(8) unsigned zerofill | YES  |     | NULL    |       |\n+-------+--------------------------------+------+-----+---------+-------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/mediumint', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/mediumint');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (31, 22, 'MIDDLEINT', 'Description\n-----------\n\nSee MEDIUMINT.\n\nExamples\n--------\n\nCREATE TABLE middleint_example (\n  example MIDDLEINT\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/middleint', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/middleint');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (32, 22, 'NUMBER', 'Description\n-----------\n\n``sql\nNUMBER[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n`\n\nIn Oracle mode, NUMBER` is a synonym for DECIMAL.\n\nExamples\n--------\n\nSET sql_mode=''oracle'';\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/number', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/number');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (33, 22, 'Numeric Data Type Overview', 'Description\n-----------\n\nThere are a number of numeric data types:\n\n BOOLEAN - Synonym for TINYINT(1)\n INT1 - Synonym for TINYINT\n INT2 - Synonym for SMALLINT\n INT3 - Synonym for MEDIUMINT\n INT, INTEGER\n INT4 - Synonym for INT\n INT8 - Synonym for BIGINT\n TINYINT\n SMALLINT\n MEDIUMINT\n BIGINT\n DECIMAL, DEC, NUMERIC, FIXED\n FLOAT\n DOUBLE, DOUBLE PRECISION, REAL\n BIT\n VECTOR\n\nSee the specific articles for detailed information on each.\n\nSIGNED, UNSIGNED and ZEROFILL\n\nMost numeric types can be defined as SIGNED, UNSIGNED or ZEROFILL, for example:\n\n``sql\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n`\n\nIf SIGNED, or no attribute, is specified, a portion of the numeric type will be reserved for the sign (plus or minus). For example, a TINYINT SIGNED can range from -128 to 127.\n\nIf UNSIGNED is specified, no portion of the numeric type is reserved for the sign, so for integer types range can be larger. For example, a TINYINT UNSIGNED can range from 0 to 255. Floating point and fixed-point types also can be UNSIGNED, but this only prevents negative values from being stored and doesn''t alter the range.\n\nIf ZEROFILL is specified, the column will be set to UNSIGNED and the spaces used by default to pad the field are replaced with zeros. ZEROFILL is ignored in expressions or as part of a UNION. ZEROFILL is a non-standard MySQL and MariaDB enhancement.\n\nNote that although the preferred syntax indicates that the attributes are exclusive, more than one attribute can be specified.\n\nOnly the following combinations are supported:\n\n SIGNED\n UNSIGNED\n ZEROFILL\n UNSIGNED ZEROFILL\n ZEROFILL UNSIGNED\n\nThe latter two should be replaced with simply ZEROFILL`, but are still accepted by the parser.\n\nExamples\n--------\n\nCREATE TABLE zf (\n  i1 TINYINT SIGNED,\n  i2 TINYINT UNSIGNED,\n  i3 TINYINT ZEROFILL\n);\n\nINSERT INTO zf VALUES (2,2,2);\n\nSELECT  FROM zf;\n+------+------+------+\n| i1   | i2   | i3   |\n+------+------+------+\n|    2 |    2 |  002 |\n+------+------+------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric-data-type-overview', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric-data-type-overview');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (34, 22, 'DEC', 'Description\n-----------\n\nSee DECIMAL.\n\nExamples\n--------\n\nCREATE TABLE dec_example (\n  example DEC\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric-data-types-dec', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric-data-types-dec');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (35, 22, 'NUMERIC', 'Description\n-----------\n\nSee DECIMAL.\n\nExamples\n--------\n\nCREATE TABLE numeric_example (\n  example NUMERIC\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (36, 22, 'REAL', 'Description\n-----------\n\nSee DOUBLE.\n\nExamples\n--------\n\nCREATE TABLE real_example (\n  example REAL\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/real', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/real');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (37, 22, 'SMALLINT', 'Syntax\n------\n\nSMALLINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so that the SMALLINT value contains a number of M digits.\n\nNote:\n\nIf the ZEROFILL attribute has been specified, the column will automatically become UNSIGNED.\n\nINT2 is a synonym for SMALLINT.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE smallints (a SMALLINT,b SMALLINT UNSIGNED,c SMALLINT ZEROFILL);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/smallint', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/smallint');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (38, 22, 'TINYINT', 'Syntax\n------\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255. For details on the attributes, see Numeric Data Type Overview.\n\nINT1, BOOL, and BOOLEAN are synonyms for TINYINT.\n\nExamples\n--------\n\nCREATE TABLE tinyints (a TINYINT,b TINYINT UNSIGNED,c TINYINT ZEROFILL);\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/tinyint', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/tinyint');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (39, 22, 'VECTOR', 'Syntax\n------\n\nVECTOR(N)\n\nDescription\n-----------\n\nThe VECTOR data type was added as part of the vectors feature, which permits MariaDB Server to perform as a relational vector database. N represents the fixed number of dimensions of the vector up to a maximum of 16383. The N dimension will be determined by the embedding algorithm.\n\nExamples\n--------\n\nCREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, v VECTOR(5) NOT NULL,\n VECTOR INDEX (v));\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/vector', '', 'https://mariadb.com/docs/server/reference/data-types/numeric-data-types/vector');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (40, 22, 'ROW TYPE OF', 'Description\n-----------\n\nThis is special declaration only available inside a stored procedure.\n\nExamples\n--------\n\nCREATE TABLE rowtypeof_table(\n  descr VARCHAR(20),\n  val INT\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/row-type-of', '', 'https://mariadb.com/docs/server/reference/data-types/row-type-of');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (41, 22, 'SERIAL', 'Description\n-----------\n\nThis is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nExamples\n--------\n\nCREATE TABLE serial_example (\n  id SERIAL,\n  data VARCHAR(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/serial', '', 'https://mariadb.com/docs/server/reference/data-types/serial');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (42, 22, 'BINARY', 'Description\n-----------\n\nThe BINARY type is similar to the CHAR type, but stores binary byte strings rather than non-binary character strings. M represents the column length in bytes.\n\nIt contains no character set, and comparison and sorting are based on the numeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the extra characters will be dropped with a warning. If strict mode is enabled, an error will occur.\n\nBINARY values are right-padded with 0x00 (the zero byte) to the specified length when inserted. The padding is _not_ removed on select, so this needs to be taken into account when sorting and comparing, where all bytes are significant. The zero byte, 0x00 is less than a space for comparison purposes.\n\nUse Cases for Zero Length\n\nA BINARY(0) or VARBINARY(0) column is restricted to an empty byte string or NULL.\n\n Schema Preservation: Use these columns when a system expects a specific column to exist, but no data storage is required for your current application.\n Space-Efficient Indicators: These columns can act as a two-state indicator where the presence of an empty byte string represents one state and NULL represents another.\n\nIf you attempt to insert a value other than an empty string, MariaDB returns an ERROR 1406 (22001) indicating the data is too long for the column.\n\nExamples\n--------\n\nCREATE TABLE bins (a BINARY(10));\n\nINSERT INTO bins VALUES(''12345678901'');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM bins;\n+------------+\n| a          |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=''STRICT_ALL_TABLES'';\n\nINSERT INTO bins VALUES(''12345678901'');\nERROR 1406 (22001): Data too long for column ''a'' at row 1\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/binary', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/binary');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (43, 22, 'BLOB and TEXT Data Types', 'Description\n-----------\n\nA BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are\n\n TINYBLOB,\n BLOB,\n MEDIUMBLOB, and\n LONGBLOB.\n\nThese differ only in the maximum length of the values they can hold.\n\nThe TEXT types are\n\n TINYTEXT,\n TEXT,\n MEDIUMTEXT, and\n LONGTEXT.\n JSON (alias for LONGTEXT)\n\nThese correspond to the four BLOB types and have the same maximum lengths and storage requirements.\n\nBLOB and TEXT columns can have a DEFAULT value.\n\nIt is possible to set a unique index on columns that use the BLOB or TEXT data types.\n\nHandling Large Data via APIs\n\nWhen working with very large BLOB or TEXT values, the data may exceed the limit set by the max_allowed_packet system variable. To avoid this—and to reduce memory consumption on the client—most MariaDB connectors allow you to "stream" data in chunks.\n\n Connector/C: Use mysql_stmt_send_long_data() to send parameter data in pieces before calling mysql_stmt_execute(). This bypasses max_allowed_packet  limits and reduces the peak memory footprint (RSS) of the application.\n Connector/J: Use PreparedStatement.setBinaryStream() (for BLOB) or PreparedStatement.setCharacterStream() (for TEXT).\n Protocol: These APIs utilize the COM_STMT_SEND_LONG_DATA command, which appends data to a parameter on the server side.\n\nTechnical Rules for C/C++\n\n 0-Based Indexing: Parameter numbering starts at 0.\n The  is_null Flag: This must be 0; if set to nonzero, the server may discard the streamed data.\n Resetting: Use  mysql_stmt_reset() to clear all accumulated long data on the server if you need to abort or retry.\n Chunk Size: A practical performance "sweet spot" is between 64 KB and 1 MB per chunk.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/blob-and-text-data-types', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/blob-and-text-data-types');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (44, 22, 'BLOB', 'Syntax\n------\n\nBLOB[(M)]\n\nDescription\n-----------\n\nIf you are handling large binary data that exceeds the max_allowed_packet limit, you can stream the data in chunks using specialized API functions like mysql_stmt_send_long_data() or setBinaryStream(). See Handling Large Data via APIs for more details.\n\nA BLOB column with a maximum length of 65,535 (2¹⁶ - 1) bytes. Each BLOB value is stored using a two-byte length prefix that indicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MariaDB creates the column as the smallest BLOB type large enough to hold values _M_ bytes long.\n\nBLOB values can also be used to store dynamic columns.\n\nBLOB and TEXT columns can both be assigned a DEFAULT value.\n\nIndexing\n\nOn a column that uses the BLOB data type, setting a unique index is now possible.\n\nNote\n\nIn previous releases, setting a unique index on a column that uses the BLOB data type was not possible. Index would only guarantee the uniqueness of a fixed number of characters.\n\nOracle Mode\n\nIn Oracle mode, BLOB is a synonym for LONGBLOB.\n\nExamples\n--------\n\nCREATE TABLE blob_example (\n   description VARCHAR(20),\n   example BLOB\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/blob', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/blob');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (45, 22, 'CHAR BYTE', 'Description\n-----------\n\nThe CHAR BYTE data type is an alias for the BINARY data type. This is a compatibility feature.\n\nExamples\n--------\n\nCREATE TABLE char_byte_example (\n  example CHAR BYTE\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/char-byte', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/char-byte');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (46, 22, 'CHAR VARYING', 'Description\n-----------\n\nThis is a synonym for VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE char_varying_example (\n  example CHAR VARYING(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/char-varying', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/char-varying');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (47, 22, 'CHAR', 'Syntax\n------\n\n[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA fixed-length string that is always right-padded with spaces to the specified length when stored. M represents the column length in characters. The range of M is 0 to 255. If M is omitted, the length is 1.\n\nTrailing spaces are removed when CHAR values are retrieved unless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nIf a unique index consists of a column where trailing pad characters are stripped or ignored, inserts into that column where values differ only by the number of trailing pad characters will result in a duplicate-key error.\n\nCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns cannot be part of an index. The CONNECT storage engine does not support CHAR(0).\n\nUse Cases for Zero Length\n\nA CHAR(0) or VARCHAR(0) column occupies minimal space and is restricted to two possible values: an empty string ('''') or NULL. You can use these columns for the following purposes:\n\n Legacy Compatibility: Include these columns to maintain compatibility with older applications that require a specific table schema, even if the data is no longer collected.\n Two-State Flags: A CHAR(0) NULL column can function as a boolean indicator. It uses only one bit of storage to distinguish between a "set" state (the empty string) and an "unset" state (NULL).\n* Row Marking: You can use a CHAR(0) column to mark a specific row in a table. For example, if you require only one "active" row, set that row to an empty string while keeping all other rows NULL.\n\nThe following error occurs if you attempt to insert any character data into a 0-length column: ERROR 1406 (22001): Data too long for column.\n\nExamples\n--------\n\nCREATE TABLE strtest (c CHAR(10));\nINSERT INTO strtest VALUES(''Maria   '');\n\nSELECT c=''Maria'',c=''Maria   '' FROM strtest;\n+-----------+--------------+\n| c=''Maria'' | c=''Maria   '' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT c LIKE ''Maria'',c LIKE ''Maria   '' FROM strtest;\n+----------------+-------------------+\n| c LIKE ''Maria'' | c LIKE ''Maria   '' |\n+----------------+-------------------+\n|              1 |                 0 |\n+----------------+-------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/char', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/char');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (48, 22, 'Character Set and Collation Overview', 'Description\n-----------\n\nWhat are Character Sets and Collations?\n\nA character set is a set of characters, while a collation comprises the rules for comparing and sorting a particular character set.\n\nFor example, a subset of a character set could consist of the letters A, B and C. A default collation could define these as appearing in an ascending order of A, B, C.\n\nIf we consider different case characters, more complexity is added. A binary collation would evaluate the characters A and a differently, ordering them in a particular way. A case-insensitive collation would evaluate A and a equivalently, while the German phone book collation evaluates the characters ue and ü equivalently.\n\nA character set can have many collations associated with it, while each collation is only associated with one character set. In MariaDB, the character set name is always part of the collation name. For example, the latin1_german1_ci collation applies only to the latin1 character set. Each character set also has one default collation. The latin1 default collation is latin1_swedish_ci.\n\nAs an example, by default, the character y comes between x and z, while in Lithuanian, it''s sorted between i and k. Similarly, the German phone book order is different to the German dictionary order, so while they share the same character set, the collation is different.\n\nViewing Character Sets and Collations\n\nThe default character set is utf8mb4 and the default collation is utf8mb4_uca1400_ai_ci.\\\nThis may differ in some distros, see for example Differences in MariaDB in Debian.\n\nThe default character set is latin1 and the default collation is latin1_swedish_ci.\\\nThis may differ in some distros, see for example Differences in MariaDB in Debian.\n\nYou can view a full list of character sets and collations supported by MariaDB at Supported Character Sets and Collations, or see what''s supported on your server with the SHOW CHARACTER SET and SHOW COLLATION commands.\n\nBy default, A comes before Z, so the following evaluates to true:\n\n``sql\nSELECT "A" < "Z";\n+-----------+\n| "A" < "Z" |\n+-----------+\n|         1 |\n+-----------+\n`\n\nBy default, comparisons are case-insensitive:\n\n`sql\nSELECT "A" < "a", "A" = "a";\n+-----------+-----------+\n| "A" < "a" | "A" = "a" |\n+-----------+-----------+\n|         0 |         1 |\n+-----------+-----------+\n`\n\nChanging Character Sets and Collations\n\nCharacter sets and collations can be set from the server level right down to the column level, as well as for client-server communication.\n\nFor example, ue and ü are by default evaluated differently.\n\n`sql\nSELECT ''Mueller'' = ''Müller'';\n+----------------------+\n| ''Müller'' = ''Mueller'' |\n+----------------------+\n|                    0 |\n+----------------------+\n`\n\nBy using the collation_connection system variable to change the connection character set to latin1_german2_ci, or German phone book, the same two characters will evaluate as equivalent.\n\n`sql\nSET collation_connection = latin1_german2_ci;\n\nSELECT ''Mueller'' = ''Müller'';\n+-----------------------+\n| ''Mueller'' = ''Müller''  |\n+-----------------------+\n|                     1 |\n+-----------------------+\n``\n\nSee Setting Character Sets and Collations for more.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/character-set-and-collation-overview', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/character-set-and-collation-overview');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (49, 22, 'Coordinated Universal Time', 'Description\n-----------\n\nUTC stands for Coordinated Universal Time. It is the world standard for regulating time.\n\nMariaDB stores values internally in UTC, converting them to the required time zone as required.\n\nIn general terms it is equivalent to Greenwich Mean Time (GMT), but UTC is used in technical contexts, as it is precisely defined at the subsecond level.\n\nTime zones are offset relative to UTC. For example, time in Tonga is UTC + 13, so 03h00 UTC is 16h00 in Tonga.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/coordinated-universal-time', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/coordinated-universal-time');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (50, 22, 'Locales Plugin', 'Description\n-----------\n\nThe LOCALES plugin creates the LOCALES table in the INFORMATION_SCHEMA database. The plugin also adds the SHOW LOCALES statement.The table and statement can be queried to see all locales that are compiled into the server.\n\nInstalling the Plugin\n\nAlthough the plugin''s shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN. For example:\n\n``sql\nINSTALL SONAME ''locales'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mysqld or it can be specified in a relevant server option group in an option file. For example:\n\n`sql\n[mariadb]\n...\nplugin_load_add = locales\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN. For example:\n\n`sql\nUNINSTALL SONAME ''locales'';\n``\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nExamples\n--------\n\nSELECT * FROM INFORMATION_SCHEMA.LOCALES;\n+-----+-------+-------------------------------------+-----------------------+---------------------+---------------+--------------+------------------------+\n| ID  | NAME  | DESCRIPTION                         | MAX_MONTH_NAME_LENGTH | MAX_DAY_NAME_LENGTH | DECIMAL_POINT | THOUSAND_SEP | ERROR_MESSAGE_LANGUAGE |\n+-----+-------+-------------------------------------+-----------------------+---------------------+---------------+--------------+------------------------+\n|   0 | en_US | English - United States             |                     9 |                   9 | .             | ,            | english                |\n|   1 | en_GB | English - United Kingdom            |                     9 |                   9 | .             | ,            | english                |\n|   2 | ja_JP | Japanese - Japan                    |                     3 |                   3 | .             | ,            | japanese               |\n|   3 | sv_SE | Swedish - Sweden                    |                     9 |                   7 | ,             |              | swedish                |\n|   4 | de_DE | German - Germany                    |                     9 |                  10 | ,             | .            | german                 |\n|   5 | fr_FR | French - France                     |                     9 |                   8 | ,             |              | french                 |\n|   6 | ar_AE | Arabic - United Arab Emirates       |                     6 |                   8 | .             | ,            | english                |\n|   7 | ar_BH | Arabic - Bahrain                    |                     6 |                   8 | .             | ,            | english                |\n|   8 | ar_JO | Arabic - Jordan                     |                    12 |                   8 | .             | ,            | english                |\n...\n| 106 | no_NO | Norwegian - Norway                  |                     9 |                   7 | ,             | .            | norwegian              |\n| 107 | sv_FI | Swedish - Finland                   |                     9 |                   7 | ,             |              | swedish                |\n| 108 | zh_HK | Chinese - Hong Kong SAR             |                     3 |                   3 | .             | ,            | english                |\n| 109 | el_GR | Greek - Greece                      |                    11 |                   9 | ,             | .            | greek                  |\n| 110 | rm_CH | Romansh - Switzerland               |                     9 |                   9 | ,             | .            | english                |\n+-----+-------+-------------------------------------+-----------------------+---------------------+---------------+--------------+------------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/locales-plugin', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/locales-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (51, 22, 'Server Locale', 'Description\n-----------\n\nThe lc_time_names server system variable sets the language used by the date and time functions DAYNAME(), MONTHNAME(), and DATE_FORMAT(), and the lc_messages sets the language for error messages.\n\nThe list of the locales supported by the current MariaDB installation can be obtained via the LOCALES plugin.\n\nMariaDB supports the following locale values:\n\n| Locale | Language          | Territory                                                                                                                                                                                                                                                     |\n| ------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ar_AE | Arabic            | United Arab Emirates                                                                                                                                                                                                                                          |\n| ar_BH | Arabic            | Bahrain                                                                                                                                                                                                                                                       |\n| ar_DZ | Arabic            | Algeria                                                                                                                                                                                                                                                       |\n| ar_EG | Arabic            | Egypt                                                                                                                                                                                                                                                         |\n| ar_IN | Arabic            | Iran                                                                                                                                                                                                                                                          |\n| ar_IQ | Arabic            | Iraq                                                                                                                                                                                                                                                          |\n| ar_JO | Arabic            | Jordan                                                                                                                                                                                                                                                        |\n| ar_KW | Arabic            | Kuwait                                                                                                                                                                                                                                                        |\n| ar_LB | Arabic            | Lebanon                                                                                                                                                                                                                                                       |\n| ar_LY | Arabic            | Libya                                                                                                                                                                                                                                                         |\n| ar_MA | Arabic            | Morocco                                                                                                                                                                                                                                                       |\n| ar_OM | Arabic            | Oman                                                                                                                                                                                                                                                          |\n| ar_QA | Arabic            | Qatar                                                                                                                                                                                                                                                         |\n| ar_SA | Arabic            | Saudi Arabia                                                                                                                                                                                                                                                  |\n| ar_SD | Arabic            | Sudan                                                                                                                                                                                                                                                         |\n| ar_SY | Arabic            | Syria                                                                                                                                                                                                                                                         |\n| ar_TN | Arabic            | Tunisia                                                                                                                                                                                                                                                       |\n| ar_YE | Arabic            | Yemen                                                                                                                                                                                                                                                         |\n| be_BY | Belarusian        | Belarus                                                                                                                                                                                                                                                       |\n| bg_BG | Bulgarian         | Bulgaria                                                                                                                                                                                                                                                      |\n| ca_ES | Catalan           | Catalan                                                                                                                                                                                                                                                       |\n| cs_CZ | Czech             | Czech Republic                                                                                                                                                                                                                                                |\n| da_DK | Danish            | Denmark                                                                                                                                                                                                                                                       |\n| de_AT | German            | Austria                                                                                                                                                                                                                                                       |\n| de_BE | German            | Belgium                                                                                                                                                                                                                                                       |\n| de_CH | German            | Switzerland                                                                                                                                                                                                                                                   |\n| de_DE | German            | Germany                                                                                                                                                                                                                                                       |\n| de_LU | German            | Luxembourg                                                                                                                                                                                                                                                    |\n| el_GR | Greek             | Greece                                                                                                                                                                                                                                                        |\n| en_AU | English           | Australia                                                                                                                                                                                                                                                     |\n| en_CA | English           | Canada                                                                                                                                                                                                                                                        |\n| en_GB | English           | United Kingdom                                                                                                                                                                                                                                                |\n| en_IN | English           | India                                                                                                                                                                                                                                                         |\n| en_NZ | English           | New Zealand                                                                                                                                                                                                                                                   |\n| en_PH | English           | Philippines                                                                                                                                                                                                                                                   |\n| en_US | English           | United States                                                                                                                                                                                                                                                 |\n| en_ZA | English           | South Africa                                                                                                                                                                                                                                                  |\n| en_ZW | English           | Zimbabwe                                                                                                                                                                                                                                                      |\n| es_AR | Spanish           | Argentina                                                                                                                                                                                                                                                     |\n| es_BO | Spanish           | Bolivia                                                                                                                                                                                                                                                       |\n| es_CL | Spanish           | Chile                                                                                                                                                                                                                                                         |\n| es_CO | Spanish           | Columbia                                                                                                                                                                                                                                                      |\n| es_CR | Spanish           | Costa Rica                                                                                                                                                                                                                                                    |\n| es_DO | Spanish           | Dominican Republic                                                                                                                                                                                                                                            |\n| es_EC | Spanish           | Ecuador                                                                                                                                                                                                                                                       |\n| es_ES | Spanish           | Spain                                                                                                                                                                                                                                                         |\n| es_GT | Spanish           | Guatemala                                                                                                                                                                                                                                                     |\n| es_HN | Spanish           | Honduras                                                                                                                                                                                                                                                      |\n| es_MX | Spanish           | Mexico                                                                                                                                                                                                                                                        |\n| es_NI | Spanish           | Ni\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/server-locale');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (52, 22, 'Setting the Language for Error Messages', 'Description\n-----------\n\nMariaDB server error messages are by default in English. However, MariaDB server also supports error message localization in many different languages. Each supported language has its own version of the error message file called errmsg.sys in a dedicated directory for that language.\n\nSupported Languages for Error Messages\n\nError message localization is supported for the following languages:\n\n Bulgarian\n Chinese (from MariaDB 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3)\n Czech\n Danish\n Dutch\n English\n Estonian\n French\n Georgian (from MariaDB 10.11.3)\n German\n Greek\n Hindi\n Hungarian\n Italian\n Japanese\n Korean\n Norwegian\n Norwegian-ny (Nynorsk)\n Polish\n Portuguese\n Romanian\n Russian\n Serbian\n Slovak\n Spanish\n Swahili (from MariaDB 11.1.2)\n Swedish\n Ukrainian\n\nSetting the lc_messages and lc_messages_dir System Variables\n\nThe lc_messages and lc_messages_dir system variables can be used to set the server locale used for error messages.\n\nThe lc_messages system variable can be specified as a locale name. The language of the associated locale will be used for error messages. See Server Locales for a list of supported locales and their associated languages.\n\nThe lc_messages system variable is set to en_US by default, which means that error messages are in English by default.\n\nIf the lc_messages system variable is set to a valid locale name, but the server can''t find an error message file for the language associated with the locale, then the default language will be used instead.\n\nThis system variable can be specified as command-line arguments to mariadbd or it can be specified in a relevant server option group in an option file. For example:\n\n``ini\n[mariadb]\n...\nlc_messages=fr_CA\n`\n\nThe lc_messages system variable can also be changed dynamically with SET GLOBAL. For example:\n\n`sql\nSET GLOBAL lc_messages=''fr_CA'';\n`\n\nIf a server has the lc_messages system variable set to the fr_CA locale like the above example, then error messages would be in French. For example:\n\n`sql\nSELECT blah;\nERROR 1054 (42S22): Champ ''blah'' inconnu dans field list\n`\n\nThe lc_messages_dir system variable can be specified either as the path to the directory storing the server''s error message files or as the path to the directory storing the specific language''s error message file.\n\nThe server initially tries to interpret the value of the lc_messages_dir system variable as a path to the directory storing the server''s error message files. Therefore, it constructs the path to the language''s error message file by concatenating the value of the lc_messages_dir system variable with the language name of the locale specified by the lc_messages system variable .\n\nIf the server does not find the error message file for the language, then it tries to interpret the value of the lc_messages_dir system variable as a direct path to the directory storing the specific language''s error message file.\n\nThis system variable can be specified as command-line arguments to mariadbd or it can be specified in a relevant server option group in an option file.\n\nFor example, to specify the path to the directory storing the server''s error message files:\n\n`ini\n[mariadb]\n...\nlc_messages_dir=/usr/share/mysql/\n`\n\nOr to specify the path to the directory storing the specific language''s error message file:\n\n`ini\n[mariadb]\n...\nlc_messages_dir=/usr/share/mysql/french/\n`\n\nThe lc_messages_dir system variable can not be changed dynamically.\n\nSetting the --language Option\n\nThe --language option can also be used to set the server''s language for error messages, but it is deprecated. It is recommended to set the lc_messages system variable instead.\n\nThe --language option can be specified either as a language name or as the path to the directory storing the language''s error message file. See Server Locales for a list of supported locales and their associated languages.\n\nThis option can be specified as command-line arguments to mariadbd or it can be specified in a relevant server option group in an option file.\n\nFor example, to specify a language name:\n\n`ini\n[mariadb]\n...\nlanguage=french\n`\n\nOr to specify the path to the directory storing the language''s error message file:\n\n`ini\n[mariadb]\n...\nlanguage=/usr/share/mysql/french/\n``\n\nCharacter Set\n\nThe character set that the error messages are returned in is determined by the character_set_results variable, which defaults to UTF8.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/setting-the-language-for-error-messages', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/setting-the-language-for-error-messages');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (53, 22, 'Time Zones', 'Description\n-----------\n\nMariaDB keeps track of several time zone settings.\n\nSetting the Time Zone\n\nThe time_zone system variable is the primary way to set the time zone. It can be specified in one of the following formats:\n\n The default value is SYSTEM, which indicates that the system time zone defined in the system_time_zone system variable will be used. Note that if you are using SYSTEM with replication in either statement or mixed mode, you MUST use the same value for system_time_zone on all slaves (otherwise TIMESTAMP columns will not replicate correctly). See System Time Zone below for more information.\n An offset from Coordinated Universal Time (UTC), such as +5:00 or -9:00, can also be used.\n If the time zone tables in the mysql database were loaded, then a named time zone, such as America/New_York, Africa/Johannesburg, or Europe/Helsinki, is also permissible. See mysql Time Zone Tables below for more information.\n\nThere are two time zone settings that can be set within MariaDB--the global server time zone, and the time zone for your current session. There is also a third time zone setting which may be relevant--the system time zone.\n\nGlobal Server Time Zone\n\nThe global server time zone can be changed at server startup by setting the --default-time-zone option either on the command-line or in a server option group in an option file. For example:\n\n``ini\n[mariadb]\n...\ndefault_time_zone = ''America/New_York''\n`\n\nThe global server time zone can also be changed dynamically by setting the time_zone system variable as a user account that has the SUPER privilege. For example:\n\n`sql\nSET GLOBAL time_zone = ''America/New_York'';\n`\n\nThe current global server time zone can be viewed by looking at the global value of the time_zone system variable. For example:\n\n`sql\nSHOW GLOBAL VARIABLES LIKE ''time_zone'';\n+---------------+--------+\n| Variable_name | Value  |\n+---------------+--------+\n| time_zone     | SYSTEM |\n+---------------+--------+\n`\n\nSession Time Zone\n\nEach session that connects to the server will also have its own time zone. This time zone is initially inherited from the global value of the time_zone system variable, which sets the session value of the same variable.\n\nA session''s time zone can be changed dynamically by setting the time_zone system variable. For example:\n\n`sql\nSET time_zone = ''America/New_York'';\n`\n\nThe current session time zone can be viewed by looking at the session value of the time_zone system variable. For example:\n\n`sql\nSHOW SESSION VARIABLES LIKE ''time_zone'';\n+---------------+--------+\n| Variable_name | Value  |\n+---------------+--------+\n| time_zone     | SYSTEM |\n+---------------+--------+\n`\n\nSystem Time Zone\n\nThe system time zone is determined when the server starts, and it sets the value of the system_time_zone system variable. The system time zone is usually read from the operating system''s environment. You can change the system time zone in several different ways, such as:\n\n If you are starting the server with mariadbd-safe, then you can set the system time zone with the --timezone option either on the command-line or in the \\[mariadbd-safe] option group in an option file. For example:\n\n`ini\n[mariadbd-safe]\ntimezone=''America/New_York''\n`\n\n If you are using a Unix-like operating system, then you can set the system time zone by setting the TZ environment variable in your shell before starting the server. For example:\n\n`bash\n$ export TZ=''America/New_York''\n$ service mariadb start\n`\n\n On some Linux operating systems, you can change the default time zone for the whole system by making the /etc/localtime symbolic link point to the desired time zone. For example:\n\n`bash\n$ sudo rm /etc/localtime\n$ sudo ln -s /usr/share/zoneinfo/America/New_York /etc/localtime\n`\n\n On some Debian-based Linux operating systems, you can change the default time zone for the whole system by executing the following:\n\n`bash\nsudo dpkg-reconfigure tzdata\n`\n\n On Linux operating systems that use systemd, you can change the default time zone for the whole system by using the timedatectl utility. For example:\n\n`bash\nsudo timedatectl set-timezone America/New_York\n``\n\nTime Zone Effects\n\nTime Zone Effects on Functions\n\nSome functions are affected by the time zone settings. These include:\n\n NOW()\n SYSDATE()\n CURDATE()\n CURTIME()\n UNIX_TIMESTAMP()\n\nSome functions are not affected. These include:\n\n UTC_DATE()\n UTC_TIME()\n UTC_TIMESTAMP()\n\nTime Zone Effects on Data Types\n\nSome data types are affected by the time zone settings.\n\n TIMESTAMP - See TIMESTAMP: Time Zones for information on how this data type is affected by time zones.\n DATETIME - See DATETIME: Time Zones for information on how this data type is affected by time zones.\n\nmysql Time Zone Tables\n\nThe mysql database contains a number of time zone tables:\n\n time_zone\n time_zone_leap_second\n time_zone_name\n time_zone_transition\n* time_zone_transition_type\n\nBy default, these time zone tables in the mysql database are created, but not populated.\n\nIf you are using a Unix-like operating system, then you can populate these tables using the mariadb-tzinfo-to-sql utility, which uses the zoneinfo data available on Linux, Mac OS X, FreeBSD and Solaris.\n\nIf you are using Windows, then you will need to import pre-populated time zone tables. These are available at MariaDB mirrors.\n\nTime zone data needs to be updated on occasion. When that happens, the time zone tables may need to be reloaded.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/time-zones', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/time-zones');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (54, 22, 'SET CHARACTER SET', 'Syntax\n------\n\nSET {CHARACTER SET | CHARSET}\n    {charset_name | DEFAULT}\n\nDescription\n-----------\n\nSets the character_set_client and character_set_results session system variables to the specified character set and collation_connection to the value of collation_database, which implicitly sets character_set_connection to the value of character_set_database.\n\nThis maps all strings sent between the current client and the server with the given mapping.\n\nExamples\n--------\n\nSHOW VARIABLES LIKE ''character_set_%'';\n+--------------------------+--------+\n| Variable_name            | Value  |\n+--------------------------+--------+\n| character_set_client     | utf8   |\n| character_set_connection | utf8   |\n| character_set_database   | latin1 |\n| character_set_filesystem | binary |\n| character_set_results    | utf8   |\n| character_set_server     | latin1 |\n| character_set_system     | utf8   |\n+--------------------------+--------+\n\nSHOW VARIABLES LIKE ''collation%'';\n+----------------------+-------------------+\n| Variable_name        | Value             |\n+----------------------+-------------------+\n| collation_connection | utf8_general_ci   |\n| collation_database   | latin1_swedish_ci |\n| collation_server     | latin1_swedish_ci |\n+----------------------+-------------------+\n\nSET CHARACTER SET utf8mb4;\n\nSHOW VARIABLES LIKE ''character_set_%'';\n+--------------------------+---------+\n| Variable_name            | Value   |\n+--------------------------+---------+\n| character_set_client     | utf8mb4 |\n| character_set_connection | latin1  |\n| character_set_database   | latin1  |\n| character_set_filesystem | binary  |\n| character_set_results    | utf8mb4 |\n| character_set_server     | latin1  |\n| character_set_system     | utf8    |\n+--------------------------+---------+\n\nSHOW VARIABLES LIKE ''collation%'';\n+----------------------+-------------------+\n| Variable_name        | Value             |\n+----------------------+-------------------+\n| collation_connection | latin1_swedish_ci |\n| collation_database   | latin1_swedish_ci |\n| collation_server     | latin1_swedish_ci |\n+----------------------+-------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/set-character-set', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/set-character-set');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (55, 22, 'SET NAMES', 'Syntax\n------\n\nSET NAMES {''charset_name''\n    [COLLATE ''collation_name''] | DEFAULT}\n\nDescription\n-----------\n\nSets the character_set_client, character_set_connection, character_set_results and, implicitly, the collation_connection session system variables to the specified character set and collation.\n\nThis determines which character set the client will use to send statements to the server, and the server will use for sending results back to the client.\n\nucs2, utf16, utf16le and utf32 are not valid character sets for SET NAMES, as they cannot be used as client character sets.\n\nThe collation clause is optional. If not defined (or if DEFAULT is specified), the default collation for the character set will be used.\n\nQuotes are optional for the character set or collation clauses.\n\nExamples\n--------\n\nSET NAMES DEFAULT;                \n\nSELECT VARIABLE_NAME, SESSION_VALUE \n    FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n    VARIABLE_NAME LIKE ''character_set_con%'' OR \n    VARIABLE_NAME LIKE ''character_set_cl%'' OR \n    VARIABLE_NAME LIKE ''character_set_re%'' OR \n    VARIABLE_NAME LIKE ''collation_c%'';\n+--------------------------+-----------------------+\n| VARIABLE_NAME            | SESSION_VALUE         |\n+--------------------------+-----------------------+\n| CHARACTER_SET_RESULTS    | utf8mb4               |\n| CHARACTER_SET_CONNECTION | utf8mb4               |\n| CHARACTER_SET_CLIENT     | utf8mb4               |\n| COLLATION_CONNECTION     | utf8mb4_uca1400_ai_ci |\n+--------------------------+-----------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/set-names', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/set-names');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (56, 22, 'Setting Character Sets and Collations', 'Description\n-----------\n\nThe default character set is utf8mb4 and the default collation is utf8mb4_uca1400_ai_ci.\\\nThis may differ in some distros, see for example Differences in MariaDB in Debian.\n\nThe default character set is latin1 and the default collation is latin1_swedish_ci.\\\nThis may differ in some distros, see for example Differences in MariaDB in Debian.\n\nIn MariaDB 11.6, the default character set changed from latin1 to utf8mb4.\n\nWhen upgrading to 11.6 or above from a previous release series, this can lead to behavior different from what you''ve been seeing in the old version.\n\nSee this section for details, including the impact on replicating to older MariaDB (or MySQL) slaves.\n\nThe character sets and the collations can be specified from the server right down to the column level, as well as for client-server connections. When changing a character set and not specifying a collation, the default collation for the new character set is always used.\n\nCharacter sets and collations always cascade down, so a column without a specified collation will look for the table default, the table for the database, and the database for the server. It''s therefore possible to have extremely fine-grained control over all the character sets and collations used in your data.\n\nDefault collations for each character set can be viewed with the SHOW COLLATION statement, for example, to find the default collation for the latin2 character set:\n\n``sql\nSHOW COLLATION LIKE ''latin2%'';\n+---------------------+---------+----+---------+----------+---------+\n| Collation           | Charset | Id | Default | Compiled | Sortlen |\n+---------------------+---------+----+---------+----------+---------+\n| latin2_czech_cs     | latin2  |  2 |         | Yes      |       4 |\n| latin2_general_ci   | latin2  |  9 | Yes     | Yes      |       1 |\n| latin2_hungarian_ci | latin2  | 21 |         | Yes      |       1 |\n| latin2_croatian_ci  | latin2  | 27 |         | Yes      |       1 |\n| latin2_bin          | latin2  | 77 |         | Yes      |       1 |\n+---------------------+---------+----+---------+----------+---------+\n`\n\nServer Level\n\nThe character_set_server system variable can be used to change the default server character set. It can be set both on startup or dynamically, with the SET command:\n\n`sql\nSET character_set_server = ''latin2'';\n`\n\nSimilarly, the collation_server variable is used for setting the default server collation.\n\n`sql\nSET collation_server = ''latin2_czech_cs'';\n`\n\nDatabase Level\n\nThe CREATE DATABASE and ALTER DATABASE statements have optional character set and collation clauses. If these are left out, the server defaults are used.\n\n`sql\nCREATE DATABASE czech_slovak_names \n  CHARACTER SET = ''keybcs2''\n  COLLATE = ''keybcs2_bin'';\n`\n\n`sql\nALTER DATABASE czech_slovak_names COLLATE = ''keybcs2_general_ci'';\n`\n\nTo determine the default character set used by a database, use:\n\n`sql\nSHOW CREATE DATABASE czech_slovak_names;\n+--------------------+--------------------------------------------------------------------------------+\n| Database           | Create Database                                                                |\n+--------------------+--------------------------------------------------------------------------------+\n| czech_slovak_names | CREATE DATABASE czech_slovak_names /!40100 DEFAULT CHARACTER SET keybcs2 / |\n+--------------------+--------------------------------------------------------------------------------+\n`\n\nAlternatively, for the character set and collation:\n\n`sql\nSELECT  FROM INFORMATION_SCHEMA.SCHEMATA;\n+--------------+--------------------+----------------------------+------------------------+----------+\n| CATALOG_NAME | SCHEMA_NAME        | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH |\n+--------------+--------------------+----------------------------+------------------------+----------+\n| def          | czech_slovak_names | keybcs2                    | keybcs2_general_ci     | NULL     |\n| def          | information_schema | utf8                       | utf8_general_ci        | NULL     |\n| def          | mysql              | latin1                     | latin1_swedish_ci      | NULL     |\n| def          | performance_schema | utf8                       | utf8_general_ci        | NULL     |\n| def          | test               | latin1                     | latin1_swedish_ci      | NULL     |\n+--------------+--------------------+----------------------------+------------------------+----------+\n`\n\nIt is also possible to specify only the collation, and, since each collation only applies to one character set, the associated character set will automatically be specified.\n\n`sql\nCREATE DATABASE danish_names COLLATE ''utf8_danish_ci'';\n\nSHOW CREATE DATABASE danish_names;\n+--------------+----------------------------------------------------------------------------------------------+\n| Database     | Create Database                                                                              |\n+--------------+----------------------------------------------------------------------------------------------+\n| danish_names | CREATE DATABASE danish_names /!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_danish_ci / |\n+--------------+----------------------------------------------------------------------------------------------+\n`\n\nAlthough there are character_set_database and collation_database system variables which can be set dynamically, these are used for determining the character set and collation for the default database, and should only be set by the server.\n\nTable Level\n\nThe CREATE TABLE and ALTER TABLE statements support optional character set and collation clauses, a MariaDB and MySQL extension to standard SQL.\n\n`sql\nCREATE TABLE english_names (id INT, name VARCHAR(40)) \n  CHARACTER SET ''utf8'' \n  COLLATE ''utf8_icelandic_ci'';\n`\n\nIf neither character set nor collation is provided, the database default will be used. If only the character set is provided, the default collation for that character set will be used . If only the collation is provided, the associated character set will be used. See Supported Character Sets and Collations.\n\n`sql\nALTER TABLE table_name\n CONVERT TO CHARACTER SET charset_name [COLLATE collation_name];\n`\n\nIf no collation is provided, the collation will be set to the default collation for that character set. See Supported Character Sets and Collations.\n\nFor VARCHAR or TEXT columns, CONVERT TO CHARACTER SET changes the data type if needed to ensure the new column is long enough to store as many characters as the original column.\n\nFor example, an ascii TEXT column requires a single byte per character, so the column can hold up to 65,535 characters. If the column is converted to utf8mb4, 4 bytes can be required for each character, so the column will be converted to MEDIUMTEXT to be able to hold the same number of characters.\n\nCONVERT TO CHARACTER SET binary will convert CHAR, VARCHAR and TEXT columns to BINARY, VARBINARY and BLOB respectively, and from that point will no longer have a character set, or be affected by future CONVERT TO CHARACTER SET statements.\n\nTo avoid data type changes resulting from CONVERT TO CHARACTER SET, use MODIFY on the individual columns instead. For example:\n\n`sql\nALTER TABLE table_name MODIFY ascii_text_column TEXT CHARACTER SET utf8;\nALTER TABLE table_name MODIFY ascii_varchar_column VARCHAR(M) CHARACTER SET utf8;\n`\n\nColumn Level\n\nCharacter sets and collations can also be specified for columns that are character types CHAR, TEXT or VARCHAR. The CREATE TABLE and ALTER TABLE statements support optional character set and collation clauses for this purpose - unlike those at the table level, the column level definitions are standard SQL.\n\n`sql\nCREATE TABLE european_names (\n  croatian_names VARCHAR(40) COLLATE ''cp1250_croatian_ci'',\n  greek_names VARCHAR(40) CHARACTER SET ''greek'');\n`\n\nIf neither collation nor character set is provided, the table default is used. If only the character set is specified, that character set''s default collation is used, while if only the collation is specified, the associated character set is used.\n\nWhen using ALTER TABLE to change a column''s character set, you need to ensure the character sets are compatible with your data. MariaDB will map the data as best it can, but it''s possible to lose data if care is not taken.\n\nThe SHOW CREATE TABLE statement or INFORMATION SCHEMA database can be used to determine column character sets and collations.\n\n`sql\nSHOW CREATE TABLE european_names\\G\n*********************** 1. row ***********************\n       Table: european_names\nCreate Table: CREATE TABLE european_names (\n  croatian_names varchar(40) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci DEFAULT NULL,\n  greek_names varchar(40) CHARACTER SET greek DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci\n`\n\n`sql\nSELECT  FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME LIKE ''european%''\\G\n************************ 1. row *********************\n           TABLE_CATALOG: def\n            TABLE_SCHEMA: danish_names\n              TABLE_NAME: european_names\n             COLUMN_NAME: croatian_names\n        ORDINAL_POSITION: 1\n          COLUMN_DEFAULT: NULL\n             IS_NULLABLE: YES\n               DATA_TYPE: varchar\nCHARACTER_MAXIMUM_LENGTH: 40\n  CHARACTER_OCTET_LENGTH: 40\n       NUMERIC_PRECISION: NULL\n           NUMERIC_SCALE: NULL\n      DATETIME_PRECISION: NULL\n      CHARACTER_SET_NAME: cp1250\n          COLLATION_NAME: cp1250_croatian_ci\n             COLUMN_TYPE: varchar(40)\n              COLUMN_KEY: \n                   EXTRA: \n              PRIVILEGES: select,insert,update,references\n          COLUMN_COMMENT: \n********************* 2. row ***********************\n           TABLE_CATALOG: def\n            TABLE_SCHEMA: danish_names\n              TABLE_NAME: european_names\n             COLUMN_NAME: greek_names\n        ORDINAL_POSITION: 2\n          COLUMN_DEFAULT: NULL\n             IS_NULLABLE: YES\n               DATA_TYPE: varchar\nCHARACTER_MAXIMUM_LENGTH: 40\n  CHARACTER_OCTET_LENGTH: 40\n       NUMERIC_PRECISION: NULL\n           NUMERIC_SCALE: NULL\n      DATETIME_PRECISION: NULL\n      CHARACTER_SET_NAME: greek\n          COLLATION_NAME: greek_general_ci\n             COLUMN_TYPE: varchar(40)\n              COLUMN_KEY: \n                   EXTRA: \n              PRIVILEGES: select,insert,update,references\n          COLUMN_COMMENT:\n`\n\nFilenames\n\nThe character_set_filesystem system variable has controlled interpretation of file names that are given as literal strings. This affects the following statements and functions:\n\n SELECT INTO DUMPFILE\n SELECT INTO OUTFILE\n LOAD DATA INFILE\n LOAD XML\n LOAD_FILE()\n\nLiterals\n\nBy default, the character set and collation used for literals is determined by the character_set_connection and collation_connection system variables. However, they can also be specified explicitly:\n\n`sql\n[_charset_name]''string'' [COLLATE collation_name]\n`\n\nThe character set of string literals that do not have a character set introducer is determined by the character_set_connection system variable.\n\nThis query always returns the same character set name in both columns.:\n\n`sql\nSELECT CHARSET(''a''), @@character_set_connection;\n`\n\ncharacter_set_client and character_set_connection are normally (e.g. during handshake, or after a SET NAMES` query) are set to equal values. However, it''s possible to set to different values.\n\nExamples\n--------\n\nCREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8 COLLATE utf8_general_ci;\nINSERT INTO t1 VALUES (''oe''),(''ö'');\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/setting-character-sets-and-collations', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/setting-character-sets-and-collations');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (57, 22, 'Supported Character Sets and Collations', 'Description\n-----------\n\nCharacter Sets\n\nYou can see which character sets are available in a particular version by running the SHOW CHARACTER SET statement or by querying the Information Schema CHARACTER_SETS Table.\n\nIt is possible to change the default collation associated with a character set. See Changing Default Collation.\n\nIt is not possible to change the default collation associated with a character set. See Changing Default Collation\n\nMariaDB supports the following character sets:\n\n| Charset  | Description                 | Default collation                                                                                                                                                                                                                                                                                                 | Maxlen                                                                               |\n| -------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |\n| armscii8 | ARMSCII-8 Armenian          | armscii8_general_ci                                                                                                                                                                                                                                                                                             | 1                                                                                    |\n| ascii    | US ASCII                    | ascii_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| big5     | Big5 Traditional Chinese    | big5_chinese_ci                                                                                                                                                                                                                                                                                                 | 2                                                                                    |\n| binary   | Binary pseudo charset       | binary                                                                                                                                                                                                                                                                                                            | 1                                                                                    |\n| cp1250   | Windows Central European    | cp1250_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| cp1251   | Windows Cyrillic            | cp1251_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| cp1256   | Windows Arabic              | cp1256_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| cp1257   | Windows Baltic              | cp1257_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| cp850    | DOS West European           | cp850_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| cp852    | DOS Central European        | cp852_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| cp866    | DOS Russian                 | cp866_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| cp932    | SJIS for Windows Japanese   | cp932_japanese_ci                                                                                                                                                                                                                                                                                               | 2                                                                                    |\n| dec8     | DEC West European           | dec8_swedish_ci                                                                                                                                                                                                                                                                                                 | 1                                                                                    |\n| eucjpms  | UJIS for Windows Japanese   | eucjpms_japanese_ci                                                                                                                                                                                                                                                                                             | 3                                                                                    |\n| euckr    | EUC-KR Korean               | euckr_korean_ci                                                                                                                                                                                                                                                                                                 | 2                                                                                    |\n| gb2312   | GB2312 Simplified Chinese   | gb2312_chinese_ci                                                                                                                                                                                                                                                                                               | 2                                                                                    |\n| gbk      | GBK Simplified Chinese      | gbk_chinese_ci                                                                                                                                                                                                                                                                                                  | 2                                                                                    |\n| geostd8  | GEOSTD8 Georgian            | geostd8_general_ci                                                                                                                                                                                                                                                                                              | 1                                                                                    |\n| greek    | ISO 8859-7 Greek            | greek_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| hebrew   | ISO 8859-8 Hebrew           | hebrew_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| hp8      | HP West European            | hp8_english_ci                                                                                                                                                                                                                                                                                                  | 1                                                                                    |\n| keybcs2  | DOS Kamenicky Czech-Slovak  | keybcs2_general_ci                                                                                                                                                                                                                                                                                              | 1                                                                                    |\n| koi8r    | KOI8-R Relcom Russian       | koi8r_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| koi8u    | KOI8-U Ukrainian            | koi8u_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| latin1   | cp1252 West European        | latin1_swedish_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| latin2   | ISO 8859-2 Central European | latin2_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| latin5   | ISO 8859-9 Turkish          | latin5_turkish_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| latin7   | ISO 8859-13 Baltic          | latin7_general_ci                                                                                                                                                                                                                                                                                               | 1                                                                                    |\n| macce    | Mac Central European        | macce_general_ci                                                                                                                                                                                                                                                                                                | 1                                                                                    |\n| macroman | Mac West European           | macroman_general_ci                                                                                                                                                                                                                                                                                             | 1                                                                                    |\n| sjis     | Shift-JIS Japanese          | sjis_japanese_ci                                                                                                                                                                                                                                                                                                | 2                                                                                    |\n| swe7     | 7bit Swedish                | swe7_swedish_ci\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/supported-character-sets-and-collations');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (58, 22, 'Unicode', 'Description\n-----------\n\nUnicode is a standard for encoding text across multiple writing systems. MariaDB supports a number of character sets for storing Unicode data:\n\n| Character Set | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ucs2        | UCS-2, each character is represented by a 2-byte code with the most significant byte first. Fixed-length 16-bit encoding.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| utf8        | utf8 is an alias for utf8mb3, but this can changed to ut8mb4 by changing the default value of the old_mode system variable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| utf8mb3     | UTF-8 encoding using one to three bytes per character. Basic Latin letters, numbers and punctuation use one byte. European and Middle East letters mostly fit into 2 bytes. Korean, Chinese, and Japanese ideographs use 3-bytes. No supplementary characters are stored. Until MariaDB 10.5, this was an alias for utf8. From MariaDB 10.6, utf8 is by default an alias for utf8mb3, but this can changed to ut8mb4 by changing the default value of the old_mode system variable. |\n| utf8mb4     | UTF-8 encoding the same as utf8mb3 but which stores supplementary characters in four bytes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| utf16       | UTF-16, same as ucs2, but stores supplementary characters in 32 bits. 16 or 32-bits.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| utf32       | UTF-32, fixed-length 32-bit encoding.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n\nSupport for the UCA-14.0.0 collations was added in MariaDB 10.10 (MDEV-27009).\n\nSupport for the MySQL 8.0 UCA-9-0-0 (utf8mb4_0900_...) collations will be added to MariaDB 11.4.5.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/unicode', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/unicode');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (59, 22, 'CHARACTER', 'Description\n-----------\n\nThis is a synonym for CHAR.\n\nExamples\n--------\n\nCREATE TABLE character_example (\n  example CHARACTER\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/character');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (60, 22, 'CLOB', 'Description\n-----------\n\nThis is a synonym for LONGTEXT.\n\nExamples\n--------\n\nSET sql_mode=''oracle'';\n\nCREATE TABLE clob_example (\n  example CLOB\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/clob', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/clob');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (61, 22, 'ENUM', 'Syntax\n------\n\nENUM(''value1'',''value2'',...) [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nAn enumeration. A string object that can have only one value, chosen from the list of values ''value1'', ''value2'', ..., NULL or the special '''' error value. In theory, an ENUM column can have a maximum of 65,535 distinct values; in practice, the real maximum depends on many factors. ENUM values are represented internally as integers.\n\nTrailing spaces are automatically stripped from ENUM values on table creation.\n\nENUM values require relatively little storage space compared to strings, either one or two bytes depending on the number of enumeration values.\n\nNULL and empty values\n\nAn ENUM can also contain NULL and empty values. If the ENUM column is declared to permit NULL values, NULL becomes a valid value, as well as the default value (see below). If strict SQL Mode is not enabled, and an invalid value is inserted into an ENUM, a special empty string, with an index value of zero (see Numeric index, below), is inserted, with a warning. This may be confusing, because the empty string is also a possible value, and the only difference if that is this case its index is not 0. Inserting will fail with an error if strict mode is active.\n\nIf a DEFAULT clause is missing, the default value will be:\n\n NULL if the column is nullable;\n otherwise, the first value in the enumeration.\n\nNumeric index\n\nENUM values are indexed numerically in the order they are defined, and sorting will be performed in this numeric order. We suggest not using ENUM to store numerals, as there is little to no storage space benefit, and it is easy to confuse the enum integer with the enum numeral value by leaving out the quotes.\n\nAn ENUM defined as ENUM(''apple'',''orange'',''pear'') would have the following index values:\n\n| Index | Value    |\n| ----- | -------- |\n| NULL  | NULL     |\n| 0     | ''''       |\n| 1     | ''apple''  |\n| 2     | ''orange'' |\n| 3     | ''pear''   |\n\nExamples\n--------\n\nCREATE TABLE fruits (\n  id INT NOT NULL auto_increment PRIMARY KEY,\n  fruit ENUM(''apple'',''orange'',''pear''),\n  bushels INT);\n\nDESCRIBE fruits;\n+---------+-------------------------------+------+-----+---------+----------------+\n| Field   | Type                          | Null | Key | Default | Extra          |\n+---------+-------------------------------+------+-----+---------+----------------+\n| id      | int(11)                       | NO   | PRI | NULL    | auto_increment |\n| fruit   | enum(''apple'',''orange'',''pear'') | YES  |     | NULL    |                |\n| bushels | int(11)                       | YES  |     | NULL    |                |\n+---------+-------------------------------+------+-----+---------+----------------+\n\nINSERT INTO fruits\n    (fruit,bushels) VALUES\n    (''pear'',20),\n    (''apple'',100),\n    (''orange'',25);\n\nINSERT INTO fruits\n    (fruit,bushels) VALUES\n    (''avocado'',10);\nERROR 1265 (01000): Data truncated for column ''fruit'' at row 1\n\nSELECT * FROM fruits;\n+----+--------+---------+\n| id | fruit  | bushels |\n+----+--------+---------+\n|  1 | pear   |      20 |\n|  2 | apple  |     100 |\n|  3 | orange |      25 |\n+----+--------+---------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/enum', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/enum');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (62, 22, 'INET4', 'Syntax\n------\n\nINET4\n\nDescription\n-----------\n\nINET4 is a data type to store IPv4 addresses, as 4-byte binary strings.\n\nCasting from INET4 data types to INET6 is permitted, allowing for example comparisons between the two data types, and for INET4 values to be inserted into INET6 columns.\n\nCasting from INET4 data types to INET6 is not permitted.\n\nExamples\n--------\n\nCREATE OR REPLACE TABLE t1 (a INET4);\n\nINSERT INTO t1 VALUES(''0.0.0.0''), (''255.10.0.0''), (''255.255.255.255'');\n\nINSERT INTO t1 VALUES (0xa0000001);\nINSERT INTO t1 VALUES (0xf0000000);\nINSERT INTO t1 VALUES (0xff000001);\n\nSELECT HEX(a), a FROM t1 ORDER BY a;\n+----------+-----------------+\n| HEX(a)   | a               |\n+----------+-----------------+\n| 00000000 | 0.0.0.0         |\n| A0000001 | 160.0.0.1       |\n| F0000000 | 240.0.0.0       |\n| FF000001 | 255.0.0.1       |\n| FF0A0000 | 255.10.0.0      |\n| FFFFFFFF | 255.255.255.255 |\n+----------+-----------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/inet4', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/inet4');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (63, 22, 'INET6', 'Syntax\n------\n\nINET6\n\nDescription\n-----------\n\nThe INET6 data type is intended for storage of IPv6 addresses, as well as IPv4 addresses assuming conventional mapping of IPv4 addresses into IPv6 addresses.\n\nBoth short and long IPv6 notation are permitted, according to RFC-5952.\n\n Values are stored as a 16-byte fixed length binary string, with most significant byte first.\n Storage engines see INET6 as BINARY(16).\n Clients see INET6 as CHAR(39) and get text representation on retrieval.\n\nThe IPv4-compatible notation is considered as deprecated. It is supported for compatibility with the INET6_ATON function, which also understands this format. It''s recommended to use the mapped format to store IPv4 addresses in INET6.\n\nWhen an IPv4 mapped (or compatible) value is stored in INET6, it still occupies 16 bytes:\n\nRetrieval\n\nOn retrieval, in the client-server text protocol, INET6 values are converted to the short text representation, according to RFC-5952, that is with all leading zeroes in each group removed and with consequent zero groups compressed.\n\nBesides creating one''s own stored function, there is no a way to retrieve an INET6 value using long text representation.\n\nCasting\n\n CAST from a character string to INET6 understands addresses in short or long text notation (including IPv4 mapped and compatible addresses). NULL is returned if the format is not understood.\n CAST from a binary string to INET6 requires a 16-byte string as an argument. NULL is returned if the argument length is not equal to 16.\n CAST from other data types to INET6 first converts data to a character string, then CAST from character string to INET6 is applied.\n CAST from INET6 to CHAR returns short text address notation.\n CAST from INET6 to BINARY returns its 16-byte binary string representation.\n CAST from INET6 to data types other than CHAR (e.g. SIGNED, UNSIGNED, TIME, etc) returns an error.\n\nComparisons\n\nAn INET6 expression can be compared to:\n\n another INET6 expression\n a character string expression with a text (short or long) address representation:\n a 16-byte binary string expression.\n\nAttempting to compare INET6 to an expression of any other data type returns an error.\n\nMixing INET6 Values for Result\n\nAn INET6 expression can be mixed for result (i.e. UNION, CASE..THEN, COALESCE etc) with:\n\n another INET6 expression. The resulting data type is INET6.\n a character string in text (short or long) address representation. The result data type is INET6. The character string counterpart is automatically converted to INET6. If the string format is not understood, it''s converted with a warning to either NULL or to ''::'', depending on the NULL-ability of the result.\n a 16-byte binary string. The resulting data type is INET6. The binary string counterpart is automatically converted to INET6. If the length of the binary string is not equal to 16, it''s converted with a warning to NULL or to ''::'' depending on the NULL-ability of the result.\n\nAttempts to mix INET6 for result with other data types will return an error.\n\nMixing INET6 with other data types for LEAST and GREATEST, when mixing for comparison and mixing for result are involved at the same time, uses the same rules with mixing for result, described in the previous paragraphs.\n\nFunctions and Operators\n\n HEX() with an INET6 argument returns a hexadecimal representation of the underlying 16-byte binary string\n Arithmetic operators (+,-,\\,/,MOD,DIV) are not supported for INET6. This may change in the future.\n The INET6_ATON function now understands INET6 values as an argument\n The prototypes of the IS_IPV4_COMPAT and I S_IPV4_MAPPED functions have changed from a BINARY(16) to a INET6,\n\nWhen the argument for the aforementioned two functions is not INET6, automatic implicit CAST to INET6 is applied. As a consequence, both functions understand arguments in both text representation and binary(16) representation.\n\nWhen the argument for the aforementioned two functions is not INET6, automatic implicit CAST to INET6 is not applied.\n\nPrepared Statement Parameters\n\nINET6 understands both text and binary(16) address representation in prepared statement parameters (PREPARE..EXECUTE and EXECUTE IMMEDIATE statements).\n\nMigration between BINARY(16) and INET6\n\nYou may have used BINARY(16) as a storage for IPv6 internet addresses, in combination with INET6_ATON and INET6_NTOA to respectively insert and retrieve data.\n\nHowever, you can ALTER BINARY(16) columns storing IPv6 addresses to INET6. After such an alter, there is no a need to use INET6_ATON() and INET6_NTOA(). Addresses can be inserted and retrieved directly.\n\nYou may use BINARY(16) as a storage for IPv6 internet addresses, in combination with INET6_ATON and INET6_NTOA to respectively insert and retrieve data.\n\nIt is also possible to convert INET6 columns to BINARY(16) and continue using the data in combination with INET6_NTOA() and INET6_ATON().\n\nExamples\n--------\n\nCREATE TABLE t1 (a INET6);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/inet6', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/inet6');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (64, 22, 'JSON Data Type', 'Description\n-----------\n\nThe JSON alias was added to make it possible to use JSON columns in statement based replication from MySQL to MariaDB and to make it possible for MariaDB to read mysqldumps from MySQL.\n\nJSON is an alias for LONGTEXT COLLATE utf8mb4_bin introduced for compatibility reasons with MySQL''s JSON data type. MariaDB implements this as a LONGTEXT rather, as the JSON data type contradicts the SQL:2016 standard, and MariaDB''s benchmarks indicate that performance is at least equivalent.\n\nIn order to ensure that a valid json document is inserted, the JSON_VALID function can be used as a CHECK constraint. This constraint is automatically included for types using the JSON alias.\n\nThe assigned text value is retained verbatim. If a value fails JSON_VALID(), an error is raised. This CHECK constraint can also be manually added to any LONGTEXT field. When a JSON object contains duplicate keys, only the first key-value pair is accessible via functions like JSON_EXTRACT().\n\nExamples\n--------\n\nCREATE TABLE t (j JSON);\n\nDESC t;\n+-------+----------+------+-----+---------+-------+\n| Field | Type     | Null | Key | Default | Extra |\n+-------+----------+------+-----+---------+-------+\n| j     | longtext | YES  |     | NULL    |       |\n+-------+----------+------+-----+---------+-------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/json', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/json');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (65, 22, 'LONG and LONG VARCHAR', 'Description\n-----------\n\nLONG and LONG VARCHAR are synonyms for MEDIUMTEXT.\n\n``sql\nCREATE TABLE t1 (a LONG, b LONG VARCHAR);\n\nDESC t1;\n+-------+------------+------+-----+---------+-------+\n| Field | Type       | Null | Key | Default | Extra |\n+-------+------------+------+-----+---------+-------+\n| a     | mediumtext | YES  |     | NULL    |       |\n| b     | mediumtext | YES  |     | NULL    |       |\n+-------+------------+------+-----+---------+-------+\n``\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/long-and-long-varchar', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/long-and-long-varchar');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (66, 22, 'LONG CHAR VARYING', 'Description\n-----------\n\nSee MEDIUMTEXT.\n\nExamples\n--------\n\nCREATE TABLE long_char_varying_example (\n  example LONG CHAR VARYING\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/long-char-varying', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/long-char-varying');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (67, 22, 'LONG CHARACTER VARYING', 'Description\n-----------\n\nSee MEDIUMTEXT.\n\nExamples\n--------\n\nCREATE TABLE long_character_varying_example (\n  example LONG CHARACTER VARYING\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/long-character-varying', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/long-character-varying');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (68, 22, 'LONG VARBINARY', 'Description\n-----------\n\nSee MEDIUMBLOB.\n\nExamples\n--------\n\nCREATE TABLE long_varbinary_example (\n  example LONG VARBINARY\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varbinary', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varbinary');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (69, 22, 'LONG VARCHAR', 'Description\n-----------\n\nSee MEDIUMTEXT.\n\nExamples\n--------\n\nCREATE TABLE long_varchar_example (\n  example LONG VARCHAR\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varchar', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varchar');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (70, 22, 'LONG VARCHARACTER', 'Description\n-----------\n\nSee MEDIUMTEXT.\n\nExamples\n--------\n\nCREATE TABLE long_varcharacter_example (\n  example LONG VARCHARACTER\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varcharacter', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varcharacter');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (71, 22, 'LONGBLOB', 'Syntax\n------\n\nLONGBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 4,294,967,295 bytes (2³² - 1), or 4GB. The effective maximum length of LONGBLOB columns depends on the configured maximum packet size in the client/server protocol and available memory. Each LONGBLOB value is stored using a four-byte length prefix that indicates the number of bytes in the value.\n\nOracle Mode\n\nIn Oracle mode, BLOB is a synonym for LONGBLOB.\n\nExamples\n--------\n\nCREATE TABLE longblob_example (\n   description VARCHAR(20),\n   example LONGBLOB\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/longblob', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/longblob');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (72, 22, 'LONGTEXT', 'Syntax\n------\n\nLONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (2³² - 1) characters. The effective maximum length is less if the value contains multi-byte characters. The effective maximum length of LONGTEXT columns also depends on the configured maximum packet size in the client/server protocol and available memory. Each LONGTEXT value is stored using a four-byte length prefix that indicates the number of bytes in the value.\n\nJSON is an alias for LONGTEXT. See JSON Data Type for details.\n\nOracle Mode\n\nIn Oracle mode, CLOB is a synonym for LONGTEXT.\n\nExamples\n--------\n\nCREATE TABLE longtext_example (\n   description VARCHAR(20),\n   example LONGTEXT\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/longtext', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/longtext');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (73, 22, 'MEDIUMBLOB', 'Syntax\n------\n\nMEDIUMBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 16,777,215 (2²⁴ - 1) bytes. Each MEDIUMBLOB value is stored using a three-byte length prefix that indicates the number of bytes in the value.\n\nLONG VARBINARY is a synonym for MEDIUMBLOB .\n\nExamples\n--------\n\nCREATE TABLE mediumblob_example (\n   description VARCHAR(20),\n   example MEDIUMBLOB\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumblob', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumblob');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (74, 22, 'MEDIUMTEXT', 'Syntax\n------\n\nMEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 16,777,215 (2²⁴ - 1) characters. The effective maximum length is less if the value contains multi-byte characters. Each MEDIUMTEXT value is stored using\\\na three-byte length prefix that indicates the number of bytes in the value.\n\nSYNONYMS\n\nThe following are synonyms for MEDIUMTEXT:\n\n LONG\n LONG CHAR VARYING\n LONG CHARACTER VARYING\n LONG VARCHAR\n* LONG VARCHARACTER\n\nExamples\n--------\n\nCREATE TABLE mediumtext_example (\n   description VARCHAR(20),\n   example MEDIUMTEXT\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumtext', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumtext');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (75, 22, 'NATIONAL CHAR VARYING', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE national_char_varying_example (\n  example NATIONAL CHAR VARYING(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/national-char-varying', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/national-char-varying');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (76, 22, 'NATIONAL CHAR', 'Description\n-----------\n\nFixed-length string of specific character set with limit up to 255 bytes.\n\nExamples\n--------\n\nCREATE TABLE national_char_example (\n  example NATIONAL CHAR(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/national-char', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/national-char');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (77, 22, 'NATIONAL CHARACTER VARYING', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE national_character_varying_example (\n  example NATIONAL CHARACTER VARYING(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/national-character-varying', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/national-character-varying');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (78, 22, 'NATIONAL CHARACTER', 'Description\n-----------\n\nSee NATIONAL CHAR.\n\nExamples\n--------\n\nCREATE TABLE national_character_example (\n  example NATIONAL CHARACTER(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/national-character', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/national-character');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (79, 22, 'NATIONAL VARCHAR', 'Description\n-----------\n\nVariable-length string of specific character set with limit up to 65,535 bytes.\n\nExamples\n--------\n\nCREATE TABLE national_varchar_example (\n  example NATIONAL VARCHAR(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/national-varchar', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/national-varchar');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (80, 22, 'NATIONAL VARCHARACTER', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE national_varcharacter_example (\n  example NATIONAL VARCHARACTER(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/national-varcharacter', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/national-varcharacter');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (81, 22, 'NCHAR VARCHAR', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE nchar_varchar_example (\n  example NCHAR VARCHAR(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varchar', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varchar');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (82, 22, 'NCHAR VARCHARACTER', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE nchar_varcharacter_example (\n  example NCHAR VARCHARACTER(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varcharacter', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varcharacter');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (83, 22, 'NCHAR VARYING', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE nchar_varying_example (\n  example NCHAR VARYING(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varying', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varying');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (84, 22, 'NCHAR', 'Description\n-----------\n\nSee NATIONAL VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE nchar_example (\n  example NCHAR(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (85, 22, 'RAW', 'Description\n-----------\n\nSee VARBINARY.\n\nExamples\n--------\n\nSET sql_mode=''oracle'';\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/raw', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/raw');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (86, 22, 'ROW', 'Syntax\n------\n\nROW (<field name> <data type> [{, <field name> <data type>}... ])\n\nDescription\n-----------\n\nROW is a data type for stored procedure variables.\n\nFeatures\n\nROW fields as normal variables\n\nROW fields (members) act as normal variables, and are able to appear in all query parts where a stored procedure variable is allowed:\n\n Assignment is using the := operator and the SET command:\n\n``sql\na.x:= 10;\na.x:= b.x;\nSET a.x= 10, a.y=20, a.z= b.z;\n`\n\n Passing to functions and operators:\n\n`sql\nSELECT f1(rec.a), rec.a<10;\n`\n\n Clauses (select list, WHERE, HAVING, LIMIT, etc...,):\n\n`sql\nSELECT var.a, t1.b FROM t1 WHERE t1.b=var.b LIMIT var.c;\n`\n\n INSERT values:\n\n`sql\nINSERT INTO t1 VALUES (rec.a, rec.b, rec.c);\n`\n\n SELECT .. INTO targets:\n\n`sql\nSELECT a,b INTO rec.a, rec.b FROM t1 WHERE t1.id=10;\n`\n\n Dynamic SQL out parameters (EXECUTE and EXECUTE IMMEDIATE)\n\n`sql\nEXECUTE IMMEDIATE ''CALL proc_with_out_param(?)'' USING rec.a;\n`\n\nROW type variables as FETCH targets\n\nROW type variables are allowed as FETCH targets:\n\n`sql\nFETCH cur INTO rec;\n`\n\nwhere cur is a CURSOR and rec is a ROW type stored procedure variable.\n\nNote, currently an attempt to use FETCH for a ROW type variable returns this error:\n\n`sql\nERROR 1328 (HY000): Incorrect number of FETCH variables\n`\n\nFETCH from a cursor cur into a ROW variable rec works as follows:\n\n The number of fields in cur must match the number of fields in rec. Otherwise, an error is reported.\n Assignment is done from left to right. The first cursor field is assigned to the first variable field, the second cursor field is assigned to the second variable field, etc.\n Field names in rec are not important and can differ from field names in cur.\n\nSee FETCH Examples (below) for examples of using this withsql_mode=ORACLE and sql_mode=DEFAULT.\n\nROW type variables as SELECT...INTO targets\n\nROW type variables are allowed as SELECT..INTO targets with some differences depending on which sql_mode is in use.\n\n When using sql_mode=ORACLE, table%ROWTYPE and cursor%ROWTYPE variables can be used as SELECT...INTO targets.\n Using multiple ROW variables in the SELECT..INTO list will report an error.\n Using ROW variables with a different column count than in the SELECT..INTO list will report an error.\n\nSee SELECT...INTO Examples (below) for examples of using this with sql_mode=ORACLE and sql_mode=DEFAULT.\n\nFeatures not implemented\n\nThe following features are planned, but not implemented yet:\n\n Returning a ROW type expression from a stored function (see MDEV-12252). This will need some grammar change to support field names after parentheses:\n\n`sql\nSELECT f1().x FROM DUAL;\n`\n\n Returning a ROW type expression from a built-in hybrid type function, such as CASE, IF, etc.\n* ROW of ROW` values\n\nExamples\n--------\n\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n  DECLARE r ROW (c1 INT, c2 VARCHAR(10));\n  SET r.c1= 10;\n  SET r.c2= ''test'';\n  INSERT INTO t1 VALUES (r.c1, r.c2);\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/row', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/row');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (87, 22, 'SET Data Type', 'Syntax\n------\n\nSET(''value1'',''value2'',...) [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA set. A string object that can have zero or more values, each of which must be chosen from the list of values ''value1'', ''value2'', ... A SET column can have a maximum of 64 members. SET values are\\\nrepresented internally as integers.\n\nSET values cannot contain commas.\n\nIf a SET contains duplicate values, an error will be returned if strict mode is enabled, or a warning if strict mode is not enabled.\n\nExamples\n--------\n\nCREATE TABLE set_example (\n  description VARCHAR(20),\n  example SET(''Foo'', ''Bar'', ''Baz'', ''Bob'')\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/set-data-type', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/set-data-type');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (88, 22, 'TEXT', 'Syntax\n------\n\nTEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nIf you are handling large text data that exceeds the max_allowed_packet limit, you can stream the data in chunks using specialized API functions like mysql_stmt_send_long_data() or setCharacterStream(). See Handling Large Data via APIs for more details.\n\nA TEXT column with a maximum length of 65,535 (2¹⁶ - 1) characters. The effective maximum length is less if the value contains multi-byte characters. Each TEXT value is stored using a two-byte length prefix that indicates the number of bytes in the value. If you need a bigger storage, consider using MEDIUMTEXT instead.\n\nAn optional length M can be given for this type. If this is done, MariaDB creates the column as the smallest TEXT type large enough to hold valuesM characters long.\n\nBLOB and TEXT columns can be assigned a DEFAULT value.\n\nExamples\n--------\n\nCREATE TABLE strtest (d TEXT(10));\nINSERT INTO strtest VALUES(''Maria   '');\n\nSELECT d=''Maria'',d=''Maria   '' FROM strtest;\n+-----------+--------------+\n| d=''Maria'' | d=''Maria   '' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT d LIKE ''Maria'',d LIKE ''Maria   '' FROM strtest;\n+----------------+-------------------+\n| d LIKE ''Maria'' | d LIKE ''Maria   '' |\n+----------------+-------------------+\n|              0 |                 1 |\n+----------------+-------------------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/text', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/text');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (89, 22, 'TINYBLOB', 'Syntax\n------\n\nTINYBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 255 (2⁸ - 1) bytes. Each TINYBLOB value is stored using a one-byte length prefix that indicates the number of bytes in the value.\n\nExamples\n--------\n\nCREATE TABLE tinyblob_example (\n   description VARCHAR(20),\n   example TINYBLOB\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/tinyblob', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/tinyblob');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (90, 22, 'TINYTEXT', 'Syntax\n------\n\nTINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 255 (2⁸ - 1) characters. The effective maximum length is less if the value contains multi-byte characters. Each TINYTEXT value is stored using a one-byte length prefix that indicates the number of bytes in the value.\n\nExamples\n--------\n\nCREATE TABLE tinytext_example (\n   description VARCHAR(20),\n   example TINYTEXT\n) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/tinytext', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/tinytext');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (91, 22, 'UUID Data Type', 'Syntax\n------\n\nUUID\n\nDescription\n-----------\n\nThe UUID data type is intended for the storage of 128-bit UUID (Universally Unique Identifier) data. See the UUID function page for more details on UUIDs themselves.\n\nRetrieval\n\nData retrieved by this data type is in the string representation defined in RFC4122.\n\nCasting\n\nString literals of hexadecimal characters and CHAR/VARCHAR/TEXT can be cast to the UUID data type. Likewise hexadecimal literals, binary-literals, and BINARY/VARBINARY/BLOB types can also be cast to UUID.\n\nThe data type will not accept a short UUID generated with the UUID_SHORT function, but will accept a value without the - character generated by the SYS_GUID function (or inserted directly). Hyphens can be partially omitted as well, or included after any group of two digits.\n\nThe type does not accept UUID values in braces, permitted by some implementations.\n\nStorage\n\nUUID values are stored in an index-friendly manner; the order of a UUID of llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn is stored as:\n\n``sql\nnnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll\n`\n\nThis provides a sorting order, assuming a UUIDv1 (node and timestamp) is used, of the node, followed by the timestamp. The key aspect is the timestamps are sequential.\n\nMariaDB starting with 10.10\n\nTaking into account that UUIDv7 and other versions are designed around time ordering, UUID values version >= 6 are stored without byte-swapping, and UUID values with version >=8 and variant=0 are now considered invalid (as the SQL standard suggests).\n\nUUID values version >= 6 are not stored without byte-swapping, and UUID` values with version >=8 and variant=0 are not considered invalid.\n\nExamples\n--------\n\nCREATE TABLE t1 (id UUID);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/uuid-data-type', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/uuid-data-type');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (92, 22, 'VARBINARY', 'Syntax\n------\n\nVARBINARY(M)\n\nDescription\n-----------\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary byte strings rather than non-binary character strings. M represents the maximum column length in bytes.\n\nIt contains no character set, and comparison and sorting are based on the numeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the extra characters will be dropped with a warning. If strict mode is enabled, an error will occur.\n\nUnlike BINARY values, VARBINARY values are not right-padded when inserting.\n\nUse Cases for Zero Length\n\nA BINARY(0) or VARBINARY(0) column is restricted to an empty byte string or NULL.\n\n Schema Preservation: Use these columns when a system expects a specific column to exist, but no data storage is required for your current application.\n Space-Efficient Indicators: These columns can act as a two-state indicator where the presence of an empty byte string represents one state and NULL represents another.\n\nIf you attempt to insert a value other than an empty string, MariaDB returns an ERROR 1406 (22001) indicating the data is too long for the column.\n\nOracle Mode\n\nIn Oracle mode, RAW is a synonym for VARBINARY.\n\nExamples\n--------\n\nCREATE TABLE varbins (a VARBINARY(10));\n\nINSERT INTO varbins VALUES(''12345678901'');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM varbins;\n+------------+\n| a          |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=''STRICT_ALL_TABLES'';\n\nINSERT INTO varbins VALUES(''12345678901'');\nERROR 1406 (22001): Data too long for column ''a'' at row 1\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/varbinary', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/varbinary');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (93, 22, 'VARCHAR', 'Syntax\n------\n\n[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA variable-length string. M represents the maximum column length in characters. The range of M is 0 to 65,532. The effective maximum length of a VARCHAR is subject to the maximum row size and the character set used. For example, utf-8 characters can require up to three bytes per character, so a VARCHAR column that uses the utf-8 character set can be declared to be a maximum of 21,844 characters.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the standard SQL way to define that a VARCHAR column should use some predefined character set. MariaDB uses utf-8 as its\\\npredefined character set, as does MySQL. NVARCHAR is shorthand for NATIONAL VARCHAR.\n\nMariaDB stores VARCHAR values as a one-byte or two-byte length prefix plus data. The length prefix indicates the number of bytes in the value. A VARCHAR column uses one length byte if values require no more than 255 bytes, two length bytes if values may require more than 255 bytes.\n\nMariaDB follows the standard SQL specification and does not remove trailing spaces from VARCHAR values.\n\nIf a unique index consists of a column where trailing pad characters are stripped or ignored, inserts into that column where values differ only by the number of trailing pad characters will result in a duplicate-key error.\n\nFor the ColumnStore engine, M represents the maximum column length in bytes.\n\nFor MariaDB, a number of NO PAD collations are available.\n\nVARCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns cannot be part of an index. The CONNECT storage engine does not support VARCHAR(0).\n\nUse Cases for Zero Length\n\nA CHAR(0) or VARCHAR(0) column occupies minimal space and is restricted to two possible values: an empty string ('''') or NULL. You can use these columns for the following purposes:\n\n Legacy Compatibility: Include these columns to maintain compatibility with older applications that require a specific table schema, even if the data is no longer collected.\n Two-State Flags: A CHAR(0) NULL column can function as a boolean indicator. It uses only one bit of storage to distinguish between a "set" state (the empty string) and an "unset" state (NULL).\n Row Marking: You can use a CHAR(0) column to mark a specific row in a table. For example, if you require only one "active" row, set that row to an empty string while keeping all other rows NULL.\n\nThe following error occurs if you attempt to insert any character data into a 0-length column: ERROR 1406 (22001): Data too long for column.\n\nSYNONYMS\n\nThe following are synonyms for VARCHAR:\n\n CHAR VARYING\n CHARACTER VARYING\n VARCHAR2\n* VARCHARACTER\n\nExamples\n--------\n\nVARCHAR(30) CHARACTER SET utf8\nNATIONAL VARCHAR(30)\nNVARCHAR(30)\nNCHAR VARCHAR(30)\nNATIONAL CHARACTER VARYING(30)\nNATIONAL CHAR VARYING(30)\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (94, 22, 'VARCHAR2', 'Description\n-----------\n\nThis is a synonym for VARCHAR.\n\nExamples\n--------\n\nSET sql_mode=''oracle'';\n\nCREATE TABLE varchar2_example (\n  example VARCHAR2(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar2', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar2');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (95, 22, 'VARCHARACTER', 'Description\n-----------\n\nSee VARCHAR.\n\nExamples\n--------\n\nCREATE TABLE varcharacter_example (\n  example VARCHARACTER(32)\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/varcharacter', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/varcharacter');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (96, 22, 'XMLTYPE', 'Description\n-----------\n\nXMLTYPE is a data type introduced in MariaDB 12.3 for storing XML data. It is designed to:\n\n Provide convenient storage of XML data\n Ensure compatibility with Oracle databases\n Support future XML validation and processing capabilities\n\nIn its initial implementatio&#x6E;_,_ XMLTYPE provides basic XML storage capabilities onl&#x79;_,_ without validation or specialized XML-specific functionalit&#x79;_._ When using string functions, the data type is effectively converted to strings and is maintained in temporary tables.\n\nCharacteristics\n\n Maximum storage capacity: 4GB (same as LONGBLOB)\n Compatibilit&#x79;: Designed to be compatible with Oracle’s XMLTYPE\n Validatio&#x6E;: XML validation or schema enforcement is not supported\n Length restrictio&#x6E;: Length cannot be specified.\n\nExample (invalid usage):\n\n``\nCREATE TABLE t1 (a XMLTYPE(6));\n`\n\nXMLTYPE does not accept length parameters, unlike data types such as VARCHAR(255) or DECIMAL(10,2)_._\n\nRelated Functions\n\nWith MariaDB 12.3, the following functions return the XMLTYPE data type:\n\n UPDATEXML&#x20;\n CAST&#x20;\n\nExamples\n\nBasic Tables Creation\n\n`\nCREATE TABLE t1(id INT, x xmltype);\nSHOW CREATE TABLE t1;\n`\n\nOutput\n\n`\nTable	Create Table\nt1	CREATE TABLE t1 (\n  id int(11) DEFAULT NULL,\n  x xmltype DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci\n`\n\nCharacter Set Specification\n\n`\nCREATE TABLE t1(id INT, x xmltype  CHARACTER SET utf8mb3) CHARACTER SET utf8mb4;\nSHOW CREATE TABLE t1;\n`\n\nOutput\n\n`\nTable	Create Table\nt1	CREATE TABLE t1 (\n  id int(11) DEFAULT NULL,\n  x xmltype CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci\n`\n\nBinary Attribute\n\n`\nCREATE TABLE t1 (a xmltype binary) CHARACTER SET utf8mb4;\nSHOW CREATE TABLE t1;\n`\n\nOutput\n\n`\nTable	Create Table\nt1	CREATE TABLE t1 (\n  a xmltype CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci\n`\n\nBasic Data Insertion and Selection\n\n`\nCREATE TABLE t1(id INT, x xmltype);\nINSERT INTO t1 VALUES (1, ''one''), (2, ''two''), (3, ''three'');\nSELECT  FROM t1;\n`\n\nOutput\n\n`\nid	x\n1	 one\n2	 two\n3	 three\n`\n\nRestrictions and Error Cases\n\nLength Specification Not Permitted\n\nIf a length parameter is provided for XMLTYPE_,_ the system returns an error:\n\n`\nCREATE TABLE t1 (a XMLTYPE(6));\n`\n\nOutput\n\n`\nERROR HY000: Data type ''XMLTYPE'' doesn''t support LENGTH attribute.\n`\n\nREF_SYSTEM_ID Attribute Not Supported\n\n`\nCREATE TABLE t1 (a XMLTYPE REF_SYSTEM_ID=4);\n`\n\nOutput\n\n`\nERROR HY000: Data type ''XMLTYPE'' doesn''t support REF_SYSTEM_ID attribute.\n\n`\n\nLength Parameters in Complex Column Definitions\n\n`\nCREATE TABLE t1(id INT, x xmltype(10, 2));\n`\n\nOutput\n\n`\nERROR HY000: Data type ''xmltype'' doesn''t support LENGTH attribute.\n``\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/xmltype', '', 'https://mariadb.com/docs/server/reference/data-types/string-data-types/xmltype');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (97, 22, 'TYPE OF', 'Description\n-----------\n\nThis is special declaration only available inside a stored procedure.\n\nExamples\n--------\n\nCREATE TABLE typeof_table(\n  descr VARCHAR(20),\n  val INT\n);\n\nURL: https://mariadb.com/docs/server/reference/data-types/type-of', '', 'https://mariadb.com/docs/server/reference/data-types/type-of');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (98, 35, 'Options, System & Status Variables', 'Description\n-----------\n\n -a (--ansii)\n --abort-slave-event-count\n Aborted_clients\n Aborted_connects\n Aborted_connects_preauth\n Access_denied_errors\n Acl_column_grants\n Acl_database_grants\n Acl_function_grants\n Acl_package_body_grants\n Acl_package_spec_grants\n Acl_procedure_grants\n Acl_proxy_users\n Acl_role_grants\n Acl_roles\n Acl_table_grants\n Acl_users\n \\--allow-suspicious-udfs, allow_suspicious_udfs\n alter_algorithm\n analyze_max_length\n analyze_sample_percentage\n \\--ansii\n aria_block_size\n aria_checkpoint_interval\n aria_checkpoint_log_activity\n aria_encrypt_tables\n aria_force_start_after_recovery_failures\n aria_group_commit\n aria_group_commit_interval\n aria_log_dir_path\n aria_log_file_size\n aria_log_purge_type\n aria_max_sort_file_size\n aria_page_checksum\n aria_pagecache_age_threshold\n aria_pagecache_blocks_not_flushed\n aria_pagecache_blocks_unused\n aria_pagecache_blocks_used\n aria_pagecache_buffer_size\n aria_pagecache_division_limit\n aria_pagecache_file_hash_size\n aria_pagecache_read_requests\n aria_pagecache_reads\n aria_pagecache_segments\n aria_pagecache_write_requests\n aria_pagecache_writes\n aria_recover\n aria_recover_options\n aria_repair_threads\n aria_sort_buffer_size\n aria_stats_method\n aria_sync_log_dir\n aria_transaction_log_syncs\n aria_used_for_temp_tables\n autocommit\n auto_increment_increment\n auto_increment_offset\n automatic_sp_privileges\n aws_key_management_key_spec\n aws_key_management_log_level\n aws_key_management_master_key_id\n aws_key_management_mock\n aws_key_management_region\n aws_key_management_request_timeout\n aws_key_management_rotate_key\n back_log\n -b, basedir\n big_tables\n bind_address\n binlog_alter_two_phase\n binlog_annotate_row_events\n Binlog_bytes_written\n Binlog_cache_disk_use\n binlog_cache_size\n Binlog_cache_use\n binlog_checksum\n binlog_commit_wait_count\n binlog_commit_wait_usec\n Binlog_commits\n binlog_direct_non_transactional_updates\n Binlog_disk_use\n --binlog-do-db, binlog_do_db\n binlog_expire_logs_seconds\n binlog_file_cache_size\n binlog_format\n Binlog_group_commits\n Binlog_group_commit_trigger_count\n Binlog_group_commit_trigger_lock_wait\n Binlog_group_commit_trigger_timeout\n binlog_gtid_index\n Binlog_gtid_index_hit\n Binlog_gtid_index_miss\n binlog_gtid_index_page_size\n binlog_gtid_index_span_min\n \\--binlog-ignore-db, binlog_ignore_db\n binlog_large_commit_threshold\n binlog_legacy_event_pos\n binlog_optimize_thread_scheduling\n binlog_row_image\n \\--binlog-row-event-max-size, binlog_row_event_max_size\n binlog_row_metadata\n Binlog_snapshot_file\n Binlog_snapshot_position\n binlog_space_limit\n Binlog_stmt_cache_disk_use\n Binlog_stmt_cache_use\n binlog_stmt_cache_size\n block_encryption_mode\n \\--bootstrap\n bulk_insert_buffer_size\n Busy_time\n Bytes_received\n Bytes_sent\n cassandra_default_thrift_host\n cassandra_failure_retries\n cassandra_insert_batch_size\n cassandra_multiget_batch_size\n Cassandra_multiget_keys_scanned\n Cassandra_multiget_reads\n Cassandra_multiget_rows_read\n Cassandra_network_exceptions\n cassandra_read_consistency\n cassandra_rnd_batch_size\n Cassandra_row_inserts\n Cassandra_row_insert_batches\n Cassandra_timeout_exceptions\n Cassandra_unavailable_exceptions\n cassandra_write_consistency\n character_set_client\n \\--character-set-client-handshake\n character_set_collations\n character_set_connection\n character_set_database\n character_set_filesystem\n character_set_results\n -C, character_set_server\n character_set_system\n character_sets_dir\n check_constraint_checks\n -r, --chroot\n collation_connection\n collation_database\n collation_server\n Column_compressions\n column_compression_threshold\n column_compression_zlib_level\n column_compression_zlib_strategy\n column_compression_zlib_wrap\n Column_decompressions\n Com_admin_commands\n Com_alter_db\n Com_alter_db_upgrade\n Com_alter_event\n Com_alter_function\n Com_alter_procedure\n Com_alter_sequence\n Com_alter_server\n Com_alter_table\n Com_alter_tablespace\n Com_alter_user\n Com_analyze\n Com_assign_to_keycache\n Com_backup\n Com_backup_lock\n Com_backup_table\n Com_begin\n Com_binlog\n Com_call_procedure\n Com_change_db\n Com_change_master\n Com_check\n Com_checksum\n Com_commit\n Com_compound_sql\n Com_create_db\n Com_create_event\n Com_create_function\n Com_create_index\n Com_create_package\n Com_create_package_body\n Com_create_procedure\n Com_create_role\n Com_create_sequence\n Com_create_server\n Com_create_table\n Com_create_temporary_table\n Com_create_trigger\n Com_create_udf\n Com_create_user\n Com_create_view\n Com_dealloc_sql\n Com_delete\n Com_delete_multi\n Com_do\n Com_drop_db\n Com_drop_event\n Com_drop_function\n Com_drop_index\n Com_drop_package\n Com_drop_package_body\n Com_drop_procedure\n Com_drop_role\n Com_drop_sequence\n Com_drop_server\n Com_drop_table\n Com_drop_temporary_table\n Com_drop_trigger\n Com_drop_user\n Com_drop_user\n Com_drop_view\n Com_empty_query\n Com_execute_immediate\n Com_execute_sql\n Com_flush\n Com_get_diagnostics\n Com_grant\n Com_grant_role\n Com_ha_close\n Com_ha_open\n Com_ha_read\n Com_help\n Com_insert\n Com_insert_select\n Com_install_plugin\n Com_kill\n Com_load\n Com_load_master_data\n Com_load_master_table\n Com_lock_tables\n Com_multi\n Com_optimize\n Com_preload_keys\n Com_prepare_sql\n Com_purge\n Com_purge_before_date\n Com_release_savepoint\n Com_rename_table\n Com_rename_user\n Com_repair\n Com_replace\n Com_replace_select\n Com_reset\n Com_resignal\n Com_restore_table\n Com_revoke\n Com_revoke_all\n Com_revoke_grant\n Com_rollback\n Com_rollback_to_savepoint\n Com_savepoint\n Com_select\n Com_set_option\n Com_show_authors\n Com_show_binlog_events\n Com_show_binlogs\n Com_show_charsets\n Com_show_client_statistics\n Com_show_collations\n Com_show_column_types\n Com_show_contributors\n Com_show_create_db\n Com_show_create_event\n Com_show_create_func\n Com_show_create_package\n Com_show_create_package_body\n Com_show_create_proc\n Com_show_create_table\n Com_show_create_trigger\n Com_show_create_user\n Com_show_databases\n Com_show_engine_logs\n Com_show_engine_mutex\n Com_show_engine_status\n Com_show_events\n Com_show_errors\n Com_show_explain\n Com_show_fields\n Com_show_function_status\n Com_show_generic\n Com_show_grants\n Com_show_keys\n Com_show_index_statistics\n Com_show_binlog_status\n Com_show_master_status\n Com_show_new_master\n Com_show_open_tables\n Com_show_package_status\n Com_show_package_body_status\n Com_show_plugins\n Com_show_privileges\n Com_show_procedure_status\n Com_show_processlist\n Com_show_profile\n Com_show_profiles\n Com_show_relaylog_events\n Com_show_slave_hosts\n Com_show_slave_status\n Com_show_status\n Com_show_storage_engines\n Com_show_table_statistics\n Com_show_table_status\n Com_show_tables\n Com_show_triggers\n Com_show_user_statistics\n Com_show_variable\n Com_show_warnings\n Com_shutdown\n Com_signal\n Com_slave_start\n Com_slave_stop\n Com_start_all_slaves\n Com_start_slave\n Com_stop_all_slaves\n Com_stop_slave\n Com_stmt_close\n Com_stmt_execute\n Com_stmt_fetch\n Com_stmt_prepare\n Com_stmt_reprepare\n Com_stmt_reset\n Com_stmt_send_long_data\n Com_truncate\n Com_uninstall_plugin\n Com_unlock_tables\n Com_update\n Com_update_multi\n Com_xa_commit\n Com_xa_end\n Com_xa_prepare\n Com_xa_recover\n Com_xa_rollback\n Com_xa_start\n completion_type\n Compression\n concurrent_insert\n connect_class_path\n connect_cond_push\n connect_conv_size\n connect_default_depth\n connect_default_prec\n connect_enable_mongo\n connect_exact_info\n connect_force_bson\n connect_indx_map\n connect_java_wrapper\n connect_json_all_path\n connect_json_grp_size\n connect_json_null\n connect_jvm_path\n connect_timeout\n connect_type_conv\n connect_use_tempfile\n connect_work_size\n connect_xtrace\n Connection_errors_accept\n Connection_errors_internal\n Connection_errors_max_connections\n Connection_errors_peer_address\n Connection_errors_select\n Connection_errors_tcpwrap\n Connections\n --console\n core_file\n Cpu_time\n \\--cracklib-password-check\n cracklib_password_check-dictionary\n create_tmp_table_binlog_formats\n Created_tmp_disk_tables\n Created_tmp_files\n Created_tmp_tables\n -h, datadir\n date_format\n datetime_format\n deadlock_search_depth_long\n deadlock_search_depth_short\n deadlock_timeout_long\n deadlock_timeout_short\n -#, debug\n --debug-assert-if-crashed-table\n --debug-binlog-fsync-sleep\n --debug-crc-break\n --debug-flush\n --debug-no-sync\n debug_no_thread_alarm\n debug_sync\n --debug-sync-timeout\n \\--default-character-set\n default_master_connection\n default_password_lifetime\n default_regex_flags\n default_storage_engine\n default_table_type\n default_tmp_storage_engine\n \\--default-time-zone\n default_week_format\n \\--defaults-extra-file\n \\--defaults-file\n delay_key_write\n Delayed_errors\n delayed_insert_limit\n Delayed_insert_threads\n delayed_insert_timeout\n delayed_queue_size\n Delayed_writes\n Delete_scan\n \\--des-key-file\n disconnect_on_expired_password\n \\--disconnect-slave-event-count\n \\--disks\n div_precision_increment\n Empty_queries\n encrypt_binlog\n encrypt_tmp_disk_tables\n encrypt_tmp_files\n encryption_algorithm\n enforce_storage_engine\n engine_condition_pushdown\n eq_range_index_dive_limit\n error_count\n event_scheduler\n Executed_events\n Executed_triggers\n -T, --exit-info\n expensive_subquery_limit\n expire_logs_days\n explicit_defaults_for_timestamp\n \\--external-locking\n external_user\n extra_max_connections\n extra_port\n Feature_application_time_periods\n Feature_check_constraint\n Feature_custom_aggregate_functions\n Feature_delay_key_write\n Feature_dynamic_columns\n Feature_fulltext\n Feature_gis\n Feature_insert_returning\n Feature_invisible_columns\n Feature_json\n Feature_locale\n Feature_subquery\n Feature_timezone\n Feature_trigger\n Feature_window_functions\n Feature_xml\n \\--feedback\n feedback_http_proxy\n feedback_send_retry_wait\n feedback_send_timeout\n feedback_server_uid\n feedback_url\n feedback_user_info\n file_key_management_encryption_algorithm\n file_key_management_filekey\n file_key_management_filename\n \\--flashback\n flush\n Flush_commands\n flush_time\n foreign_key_checks\n ft_boolean_syntax\n ft_max_word_len\n ft_min_word_len\n ft_query_expansion_limit\n ft_stopword_file\n \\--gdb\n general_log\n general_log_file\n \\--getopt-prefix-matching\n group_concat_max_len\n gssapi_keytab_path\n gssapi_principal_name\n gssapi_mech_name\n gtid_binlog_pos\n gtid_binlog_state\n gtid_cleanup_batch_size\n gtid_current_pos\n gtid_domain_id\n gtid_ignore_duplicates\n gtid_pos_auto_engines\n gtid_seq_no\n gtid_slave_pos\n gtid_strict_mode\n -h, datadir\n Handler_commit\n Handler_delete\n Handler_discover\n Handler_external_lock\n Handler_icp_attempts\n Handler_icp_match\n Handler_mrr_init\n Handler_mrr_key_refills\n Handler_mrr_rowid_refills\n Handler_prepare\n Handler_read_first\n Handler_read_key\n Handler_read_last\n Handler_read_next\n Handler_read_prev\n Handler_read_retry\n Handler_read_rnd\n Handler_read_rnd_deleted\n Handler_read_rnd_next\n Handler_rollback\n Handler_savepoint\n Handler_savepoint_rollback\n Handler_tmp_delete\n Handler_tmp_update\n Handler_tmp_write\n Handler_update\n Handler_write\n handlersocket_accept_balance\n handlersocket_address\n handlersocket_backlog\n handlersocket_epoll\n handlersocket_plain_secret\n handlersocket_plain_secret_wr\n handlersocket_port\n handlersocket_port_wr\n handlersocket_rcvbuf\n handlersocket_readsize\n handlersocket_sndbuf\n handlersocket_threads\n handlersocket_threads_wr\n handlersocket_timeout\n handlersocket_verbose\n handlersocket_wrlock_timeout\n hashicorp-key-management-cache-timeout\n hashicorp-key-management-cache-version-timeout\n hashicorp-key-management-caching-enabled\n hashicorp-key-management-check-kv-version\n hashicorp-key-management-max-retries\n hashicorp-key-management-timeout\n hashicorp-key-management-token\n hashicorp-key-management-use-cache-on-timeout\n hashicorp-key-management-vault-ca\n hashicorp-key-management-vault-url\n have_compress\n have_crypt\n have_csv\n have_dynamic_loading\n have_geometry\n have_innodb\n have_ndbcluster\n have_openssl\n have_partitioning\n have_profiling\n have_query_cache\n have_rtree_keys\n have_ssl\n have_symlink\n \\--help\n histogram_size\n histogram_type\n host_cache_size\n hostname\n identity\n idle_readonly_transaction_timeout\n idle_transaction_timeout\n idle_write_transaction_timeout\n ignore_db_dirs\n ignore_builtin_innodb\n in_predicate_conversion_threshold\n in_transaction\n init_connect\n init_file\n \\--init-rpl-role\n init_slave\n \\--innodb\n innodb_adaptive_checkpoint\n innodb_adaptive_flushing\n innodb_adaptive_flushing_lwm\n innodb_adaptive_flushing_method\n Innodb_adaptive_hash_cells\n Innodb_adaptive_hash_hash_searches\n Innodb_adaptive_hash_heap_buffers\n innodb_adaptive_hash_index\n innodb_adaptive_hash_index_partitions\n innodb_adaptive_hash_index_parts\n Innodb_adaptive_hash_non_hash_searches\n innodb_adaptive_max_sleep_delay\n innodb_additional_mem_pool_size\n innodb_alter_copy_bulk\n innodb_api_bk_commit_interval\n innodb_api_disable_rowlock\n innodb_api_enable_binlog\n innodb_api_enable_mdl\n innodb_api_trx_level\n Innodb_async_reads_pending\n Innodb_async_reads_queue_size\n Innodb_async_reads_tasks_running\n Innodb_async_reads_total_enqueues\n Innodb_async_reads_total_count\n Innodb_async_reads_wait_slot_sec\n Innodb_async_writes_pending\n Innodb_async_writes_queue_size\n Innodb_async_writes_tasks_running\n Innodb_async_writes_total_enqueues\n Innodb_async_writes_total_count\n Innodb_async_writes_wait_slot_sec\n innodb-auto-lru-dump\n innodb_autoextend_increment\n innodb_autoinc_lock_mode\n Innodb_available_undo_logs\n Innodb_background_log_sync\n innodb_background_scrub_data_check_interval\n innodb_background_scrub_data_compressed\n innodb_background_scrub_data_interval\n innodb_background_scrub_data_uncompressed\n innodb_blocking_buffer_pool_restore\n innodb_buf_dump_status_frequency\n Innodb_buffer_pool_bytes_data\n Innodb_buffer_pool_bytes_dirty\n innodb_buffer_pool_chunk_size\n innodb_buffer_pool_dump_at_shutdown\n innodb_buffer_pool_dump_now\n innodb_buffer_pool_dump_pct\n Innodb_buffer_pool_dump_status\n innodb_buffer_pool_evict\n innodb_buffer_pool_filename\n innodb_buffer_pool_instances\n innodb_buffer_pool_load_abort\n innodb_buffer_pool_load_at_startup\n innodb_buffer_pool_load_now\n Innodb_buffer_pool_load_incomplete\n innodb_buffer_pool_load_pages_abort\n Innodb_buffer_pool_load_status\n Innodb_buffer_pool_pages_data\n Innodb_buffer_pool_pages_dirty\n Innodb_buffer_pool_pages_flushed\n Innodb_buffer_pool_pages_LRU_flushed\n Innodb_buffer_pool_pages_LRU_freed\n Innodb_buffer_pool_pages_free\n Innodb_buffer_pool_pages_made_not_young\n Innodb_buffer_pool_pages_made_young\n Innodb_buffer_pool_pages_misc\n Innodb_buffer_pool_pages_old\n Innodb_buffer_pool_pages_total\n innodb_buffer_pool_populate\n Innodb_buffer_pool_read_ahead\n Innodb_buffer_pool_read_ahead_evicted\n Innodb_buffer_pool_read_ahead_rnd\n Innodb_buffer_pool_read_requests\n Innodb_buffer_pool_reads\n Innodb_buffer_pool_resize_status\n innodb_buffer_pool_restore_at_startup\n innodb_buffer_pool_shm_checksum\n innodb_buffer_pool_shm_key\n innodb_buffer_pool_size\n innodb_buffer_pool_size_auto_min\n innodb_buffer_pool_size_max\n Innodb_buffer_pool_wait_free\n Innodb_buffer_pool_write_requests\n Innodb_buffered_aio_submitted\n innodb_change_buffer_dump\n innodb_change_buffer_max_size\n innodb_change_buffering\n innodb_change_buffering_debug\n Innodb_checkpoint_age\n innodb_checkpoint_age_target\n Innodb_c\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/full-list-of-mariadb-options-system-and-status-variables');















INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (114, 5, 'Plugin Maturity', 'Description\n-----------\n\nThe following table lists the various plugins included in MariaDB ordered by their maturity. Note that maturity will differ across MariaDB versions - see below for an easy way to get a complete list of plugins and their maturity in your version of MariaDB:\n\n| Plugin                                                                                                                                                                                                        | Version | Maturity                                                     |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------ |\n| Archive                                                                                                                                                   | 3.0     | Stable                                                       |\n| Aria                                                                                                                                                           | 1.6     | Stable                                                       |\n| Audit Plugin                                                                                                                                  | 1.4     | Stable                                                       |\n| aws_key_management                                                    | 1.0     | Stable                                                       |\n| binlog                                                                                                                                       | 2.0     | Stable                                                       |\n| Blackhole                                                                                                                                               | 1.0     | Stable                                                       |\n| Connect                                                                                                                                                     | 1.7     | Stable                                                       |\n| CLIENT_STATISTICS                                                            | 2.0     | Stable                                                       |\n| cracklib_password_check                                                                                                                 | 1.0     | Stable                                                       |\n| CSV                                                                                                                                                             | 1.0     | Stable                                                       |\n| DECLARE BY / associative array                                                                                                       | 1.0     | Gamma                                                        |\n| DISKS                                                                                                                                                                     | 1.1     | Stable                                                       |\n| ed25519                                                                                                                                         | 1.1     | Stable                                                       |\n| FederatedX                                                                                                                                | 2.1     | Stable                                                       |\n| Feedback                                                                                                                                                               | 1.1     | Stable                                                       |\n| file_key_management                                                  | 2.0     | Gamma                                                        |\n| gssapi                                                                                                                                           | 1.0     | Stable                                                       |\n| INDEX_STATISTICS                                                             | 2.0     | Stable                                                       |\n| INET4                                                                                                                                                                            | 1.0     | Gamma                                                        |\n| INET6                                                                                                                                                          | 1.0     | Stable                                                       |\n| InnoDB                                                                                                                                                       | 10.\\*   | Stable                                                       |\n| LOCALES                                                                                          | 1.0     | Stable                                                       |\n| Memory                                                                                                                                      | 1.0     | Stable                                                       |\n| METADATA_LOCK_INFO                                                                                                                                         | 0.1     | Stable                                                       |\n| mhnsw                                                                                                                                                                            | 1.0     | Stable                                                       |\n| MRG_MyISAM                                                                                                                                                 | 1.0     | Stable                                                       |\n| Mroonga                                                                                                                                                     | 7.7     | Stable                                                       |\n| MyISAM                                                                                                                                        | 1.0     | Stable                                                       |\n| MyRocks                                                                                                                                                     | 1.0     | Stable                                                       |\n| mysql_json                                                                                                                                                                 | 0.1     | Stable                                                       |\n| mysql_native_password                                                                                                           | 1.0     | Stable                                                       |\n| mysql_old_password                                                                                                                 | 1.0     | Stable                                                       |\n| named_pipe                                                                                                                                  | 1.0     | Stable                                                       |\n| online_alter_log                                                                                                                                                    | 2.0     | Stable                                                       |\n| pam                                                                                        | 1.0     | Stable                                                       |\n| password_reuse_check                                                                                                                       | 2.0     | <p>Stable<br>(introduced in 10.10.2, 10.9.5, and 10.8.7)</p> |\n| partition                                                                                                                                                                                                   | 1.0     | Stable                                                       |\n| Performance_Schema                                                                                                                                                | 0.1     | Stable                                                       |\n| QUERY_CACHE_INFO                                                                                                                                      | 1.1     | Stable                                                       |\n| query_response_time                                                                                                                                       | 1.0     | Stable                                                       |\n| S3                                                                                                                                                | 1.0     | Stable                                                       |\n| semisync                                                                                                                   | 1.0     | Stable                                                       |\n| Sequence                                                                                                                                  | 1.0     | Stable                                                       |\n| SERVER_AUDIT                                                                                                                                                                     | 2.6     | Stable                                                       |\n| simple_password_check                                                                                                                     | 1.0     | Stable                                                       |\n| Spider                                                                                                                                                       | 3.3     | Stable                                                       |\n| SQL_ERROR_LOG                                                                                                                  | 1.0     | Stable                                                       |\n| SYS_REFCURSOR                                                                                                         | 1.0     | Gamma                                                        |\n| TABLE_STATISTICS                                                             | 2.0     | Stable                                                       |\n| USER_STATISTICS                                                              | 2.0     | Stable                                                       |\n| user_variables                                                                                                                                                  | 1.0     | Stable                                                       |\n| TokuDB                                                                                                                                | 4.0     | <p>Stable<br>(removed in 10.6)</p>                           |\n| unix_socket                                                                                                                                | 1.1     | Stable                                                       |\n| UUID                                                                                                                                                  | 1.0     | <p>Stable<br>(introduced in 10.9.1)</p>                      |\n| uuid_v4                                                                                                                        | 1.0     | Stable                                                       |\n| uuid_v7                                                                                                                        | 1.0     | Stable                                                       |\n| wsrep                                                                                                                               | 1.0     | Stable                                                       |\n| wsrep_connections                                                                                | 1.0     | Stable                                                       |\n| WSREP_INFO                                                                                                                                    | 1.0     | Stable                                                       |\n| wsrep_provider                                                                                                                                   | 1.0     | Stable                                                       |\n| wsrep_thd_info                                                                                    | 1.0     | Stable                                                       |\n| OQGraph                                                                                                                                      | 3.0     | Gamma                                                        |\n| Sphinx                                                                                                                                        | 2.0     | Gamma                                                        |\n| Columnstore                                                                                                                         | 1.0     | Beta                                                         |\n| handlersocket                                                                                                                                                     | 1.0     | Beta                                                         |\n| Cassandra                                                                                                                          | 0.1     |\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/plugins/information-on-plugins/list-of-plugins');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (115, 5, 'Audit Plugin Configuration', 'Description\n-----------\n\nAfter the audit plugin has been installed and loaded, there will be some new global variables within MariaDB. These can be used to configure many components, limits, and methods related to auditing the server. You may set these variables related to the logs, such as their location, size limits, rotation parameters, and method of logging information. You may also set what information is logged, such connects, disconnects, and failed attempts to connect. You can also have the audit plugin log queries, read and write access to tables. So as not to overload your logs, the audit plugin can be configured based on lists of users. You can include or exclude the activities of specific users in the logs.\n\nTo see a list of audit plugin-related variables on the server and their values, execute the follow while connected to the server:\n\n``sql\nSHOW GLOBAL VARIABLES LIKE ''server_audit%'';\n+-------------------------------+-----------------------+\n| Variable_name                 | Value                 |\n+-------------------------------+-----------------------+\n| server_audit_events           |                       |\n| server_audit_excl_users       |                       |\n| server_audit_file_buffer_size | 0                     |\n| server_audit_file_path        | server_audit.log      |\n| server_audit_file_rotate_now  | OFF                   |\n| server_audit_file_rotate_size | 1000000               |\n| server_audit_file_rotations   | 9                     |\n| server_audit_incl_users       |                       |\n| server_audit_logging          | OFF                   |\n| server_audit_mode             | 0                     |\n| server_audit_output_type      | file                  |\n| server_audit_query_log_limit  | 1024                  |\n| server_audit_sync_log_file    | OFF                   |\n| server_audit_syslog_facility  | LOG_USER              |\n| server_audit_syslog_ident     | mysql-server_auditing |\n| server_audit_syslog_info      |                       |\n| server_audit_syslog_priority  | LOG_INFO              |\n+-------------------------------+-----------------------+\n17 rows in set (0.003 sec)\n`\n\n`sql\nSHOW GLOBAL VARIABLES LIKE ''server_audit%'';\n\n+-------------------------------+-----------------------+\n| Variable_name                 | Value                 |\n+-------------------------------+-----------------------+\n| server_audit_events           | CONNECT,QUERY,TABLE   |\n| server_audit_excl_users       |                       |\n| server_audit_file_path        | server_audit.log      |\n| server_audit_file_rotate_now  | OFF                   |\n| server_audit_file_rotate_size | 1000000               |\n| server_audit_file_rotations   | 9                     |\n| server_audit_incl_users       |                       |\n| server_audit_logging          | ON                    |\n| server_audit_mode             | 0                     |\n| server_audit_output_type      | file                  |\n| server_audit_query_log_limit  | 1024                  |\n| server_audit_syslog_facility  | LOG_USER              |\n| server_audit_syslog_ident     | mysql-server_auditing |\n| server_audit_syslog_info      |                       |\n| server_audit_syslog_priority  | LOG_INFO              |\n+-------------------------------+-----------------------+\n`\n\nThe values of these variables can be changed by an administrator with the SUPER privilege, using the SET statement. Below is an example of how to disable audit logging:\n\n`sql\nSET GLOBAL server_audit_logging=OFF;\n`\n\nAlthough it is possible to change all of the variables shown above, some of them may be reset when the server restarts. Therefore, you may want set them in the configuration file (e.g., /etc/my.cnf.d/server.cnf) to ensure the values are the same after a restart:\n\n`ini\n[server]\n... \nserver_audit_logging=OFF \n…\n`\n\nFor the reason given in the paragraph above, you would not generally set variables related to the auditing plugin using the SET statement. However, you might do so to test settings before making them more permanent. Since one cannot always restart the server, you would use the SET` statement to change immediately the variables and then include the same settings in the configuration file so that the variables are set again as you prefer when the server is restarted.\n\nConfiguring Logs and Setting Other Variables\n\nOf all of the server variables you can set, you may want to set initially the server_audit_events variable to tell the Audit Plugin which events to log. The Log Settings documentation page describes in detail the choices you have and provides examples of log entries related to them.\n\nYou can see a detailed list of system variables related to the MariaDB Audit Plugin on the System Variables documentation page. Status variables related to the Audit Plugin are listed and explained on the Status Variables documentation page.\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-configuration', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-configuration');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (116, 5, 'Audit Plugin Installation', 'Description\n-----------\n\nThe server_audit plugin logs the server''s activity. For each client session, it records who connected to the server (i.e., user name and host), what queries were executed, and which tables were accessed and server variables that were changed. This information is stored in a rotating log file or it may be sent to the local syslogd.\n\nLocating the Plugin\n\nThe server_audit plugin''s shared library is included in MariaDB packages as the server_audit.so or server_audit.dll shared library on systems where it can be built.\n\nThe plugin must be located in the plugin directory, the directory containing all plugin libraries for MariaDB. The path to this directory is configured by the plugin_dir system variable. To see the value of this variable and thereby determine the file path of the plugin library, execute the following SQL statement:\n\n``sql\nSHOW GLOBAL VARIABLES LIKE ''plugin_dir'';\n\n+---------------+--------------------------+\n| Variable_name | Value                    |\n+---------------+--------------------------+\n| plugin_dir    | /usr/lib64/mysql/plugin/ |\n+---------------+--------------------------+\n`\n\nCheck the directory returned at the filesystem level to make sure that you have a copy of the plugin library, server_audit.so or server_audit.dll, depending on your system. It''s included in recent installations of MariaDB. If you do not have it, you should upgrade MariaDB.\n\nInstalling the Plugin\n\nAlthough the plugin''s shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n`sql\nINSTALL SONAME ''server_audit'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mariadbd , or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = server_audit\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME ''server_audit'';\n`\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nProhibiting Uninstallation\n\nThe UNINSTALL SONAME or UNINSTALL PLUGIN statements may be used to uninstall plugins. For the server_audit plugin, you might want to disable this capability. To prevent the plugin from being uninstalled, you could set the server_audit option to FORCE_PLUS_PERMANENT in a relevant server option group in an option file after the plugin is loaded once:\n\n`ini\n[mariadb]\n...\nplugin_load_add = server_audit\nserver_audit=FORCE_PLUS_PERMANENT\n`\n\nOnce you''ve added the option to the server''s option file and restarted the server, the plugin can''t be uninstalled. If someone tries to uninstall the audit plugin, then an error message will be returned. Below is an example of the error message:\n\n`sql\nUNINSTALL PLUGIN server_audit;\n\nERROR 1702 (HY000):\nPlugin ''server_audit'' is force_plus_permanent and can not be unloaded\n`\n\nFor more information on FORCE_PLUS_PERMANENT` and other option values for the server_audit option, see Plugin Overview: Configuring Plugin Activation at Server Startup for more information.\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-installation', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-installation');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (117, 5, 'Audit Plugin Location and Rotation of Logs', 'Description\n-----------\n\nLogs can be written to a separate file or to the system logs. If you prefer to have the logging separated from other system information, the value of the variable server_audit_output_type should be set to file. Incidentally, file is the only option on Windows systems.\n\nYou can force a rotation by enabling the server_audit_file_rotate_now variable like so:\n\n``sql\nSET GLOBAL server_audit_file_rotate_now = ON;\n`\n\nSeparate log files\n\nIn addition to setting server_audit_output_type, you will have to provide the file path and name of the audit file. This is set in the variable server_audit_file_path. You can set the file size limit of the log file with the variable server_audit_file_rotate_size.\n\nSo, if rotation is on and the log file has reached the size limit you set, a copy is created with a consecutive number as extension the original file will be truncated to be used for the auditing again. To limit the number of log files created, set the variable server_audit_file_rotations. You can force log file rotation by setting the variable server_audit_file_rotate_now to a value of ON. When the number of files permitted is reached, the oldest file will be overwritten. Here is how those variables might be set in a server configuration file:\n\n`ini\n[mysqld]\n...\nserver_audit_file_rotate_now=ON \nserver_audit_file_rotate_size=1000000 \nserver_audit_file_rotations=5\n...\n`\n\nSystem logs\n\nFor security reasons, it''s better sometimes to use the system logs instead of a local file owned by the mysql user. To do this, the value of server_audit_output_type needs to be set to syslog. Advanced configurations, such as using a remote syslogd service, are part of the syslogd configuration.\n\nThe variables, server_audit_syslog_ident and server_audit_syslog_info can be used to identify a system log entry made by the audit plugin. If a remote syslogd service is used for several MariaDB servers, these same variables are also used to identify the MariaDB server.\n\nHere is a system log entry taken from a server which had server_audit_syslog_ident set to the default value of mysql­-server_auditing, and server_audit_syslog_info set to <prod1>.\n\n`sql\nAug 717:19:58localhostmysql-­server_auditing: \n<prod1> localhost.localdomain,root,localhost,1,7, \nQUERY, mysql, ''SELECT * FROM user'',0\n`\n\nAlthough the default values for server_audit_syslog_facility and server_audit_syslog_priority should be sufficient in most cases. They can be changed based on the definition in syslog.h for the functions openlog() and syslog()`.\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-location-and-rotation-of-logs', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-location-and-rotation-of-logs');


INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (120, 5, 'Audit Plugin Options and System Variables', 'Description\n-----------\n\nThere are a several options and system variables related to the MariaDB Audit Plugin, once it has been installed. System variables can be displayed using the SHOW VARIABLES statement like so:\n\n``sql\nSHOW GLOBAL VARIABLES LIKE ''server_audit%'';\n+-------------------------------+-----------------------+\n| Variable_name                 | Value                 |\n+-------------------------------+-----------------------+\n| server_audit_events           |                       |\n| server_audit_excl_users       |                       |\n| server_audit_file_buffer_size | 0                     |\n| ...                           | ...                   |\n| server_audit_syslog_priority  | LOG_INFO              |\n| server_audit_timestamp_format | %Y%m%d %H:%i:%s       |\n+-------------------------------+-----------------------+\n`\n\nTo change the value of one of these variables, you can use the SET statement, or set them at the command-line when starting MariaDB. It''s recommended that you set them in the MariaDB configuration for the server like so:\n\n`ini\n[mariadb]\n...\nserver_audit_excl_users=''bob,ted''\n...\n`\n\nSystem Variables\n\nBelow is a list of all system variables related to the Audit Plugin. See Server System Variables for a complete list of system variables and instructions on setting them. See also the full list of MariaDB options, system and status variables.\n\nserver_audit_events\n\n Description: If set, this restricts audit logging to certain event types. If not set, every event type is logged to the audit log.\n Command line: --server-audit-events=value\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: Empty string\n Valid values:\n   CONNECT, QUERY, TABLE (MariaDB Audit Plugin < 1.2.0)\n   CONNECT, QUERY, TABLE, QUERY_DDL, QUERY_DML (MariaDB Audit Plugin >= 1.2.0)\n   CONNECT, QUERY, TABLE, QUERY_DDL, QUERY_DML, QUERY_DCL (MariaDB Audit Plugin >=1.3.0)\n   CONNECT, QUERY, TABLE, QUERY_DDL, QUERY_DML, QUERY_DCL, QUERY_DML_NO_SELECT (MariaDB Audit Plugin >= 1.4.4)\n   Consult MariaDB Audit Plugin - Versions for a list of MariaDB releases and their corresponding Audit Plugin versions.\n\nserver_audit_excl_users\n\n Description: If not empty, it contains the list of users whose activity will NOT be logged: SET GLOBAL server_audit_excl_users=''user_foo, user_bar''. CONNECT records aren''t affected by this variable - they are always logged. The user is still logged if it''s specified in server_audit_incl_users.\n Command line: --server-audit-excl-users=_value_\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: Empty string\n Size limit: 1024 characters\n\nserver_audit_file_buffer_size\n\n Description: Size (in bytes) of file buffer to make logging faster. Values > 0 are adjusted in increments of 8192. (For instance, a value of 100 would be adjusted to 8192.)\n Command line: --server-audit-file-buffer-size=_#_\n Scope: Global\n Dynamic: Yes\n Data type: numeric\n Value range: 0 to 65536\n Default value: 0 (no buffering)\n Introduced: MariaDB 12.1\n Usage: See description\n\nserver_audit_file_path\n\n Description: When server_audit_output_type=file, sets the path and the filename to the log file. If the specified path exists as a directory, then the log will be created inside that directory with the name ''server_audit.log''. Otherwise the value is treated as a filename. The default value is ''server_audit.log'', which means this file will be created in the database directory.\n Command line: --server-audit-file-path=value\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: server_audit.log\n\nserver_audit_file_rotate_now\n\n Description: When server_audit_output_type=file, the user can force the log file rotation by setting this variable to ON or 1.\n Command line: --server-audit-rotate-now[={0|1}]\n Scope: Global\n Dynamic: Yes\n Data type: boolean\n Default value: OFF\n\nserver_audit_file_rotate_size\n\n Description: When server_audit_output_type=file, it limits the size of the log file to the given amount of bytes. Reaching that limit turns on the rotation - the current log file is renamed as ''file_path.1''. The empty log file is created as ''file_path'' to log into it. The default value is 1000000.\n Command line: --server-audit-rotate-size=#\n Scope: Global\n Dynamic: Yes\n Data Type: numeric\n Default Value: 1000000\n Range: 100 to 9223372036854775807\n\nserver_audit_file_rotations\n\n Description: When server_audit_output_type=file'', this specifies the number of rotations to save. If set to 0 then the log never rotates. The default value is 9.\n Command line: --server-audit-rotations=#\n Scope: Global\n Dynamic: Yes\n Data type: numeric\n Default value: 9\n Range: 0 to 999\n\nserver_audit_incl_users\n\n Description: If not empty, it contains a comma-delimited list of users whose activity will be logged: SET GLOBAL server_audit_incl_users=''user_foo, user_bar''. CONNECT records aren''t affected by this variable - they are always logged. This setting has higher priority than server_audit_excl_users. So if the same user is specified both in incl_ and excl_ lists, they will still be logged.\n Command line: --server-audit-incl-users=value\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: Empty string\n Size limit: 1024 characters\n\nserver_audit_loc_info\n\n Description: Used by plugin internals. It has no useful meaning to users.\n   In earlier versions, users see it as a read-only variable.\n   In later versions, it is hidden from the user.\n Command line: N/A\n Scope: Global\n Dynamic: No\n Data Type: string\n Default Value: Empty string\n\nserver_audit_logging\n\n Description: Enables/disables the logging. Expected values are ON/OFF: SET GLOBAL server_audit_logging=on If the server_audit_output_type is FILE, this will actually create/open the logfile so the server_audit_file_path should be properly specified beforehand. Same about the SYSLOG-related parameters. The logging is turned off by default.\n Command line: --server-audit-logging[={0|1}]\n Scope: Global\n Dynamic: Yes\n Data type: boolean\n Default value: OFF\n\nserver_audit_mode\n\n Description: This variable doesn''t have any distinctive meaning for a user. Its value mostly reflects the server version with which the plugin was started and is intended to be used by developers for testing.\n Command line: --server-audit-mode[=#]\n Scope: Global\n Dynamic: Yes\n Data type: numeric\n Default value: 0\n Range: 0 to 1\n\nserver_audit_output_type\n\n Description: Specifies the desired output type. Can be SYSLOG, FILE or null as no output: SET GLOBAL server_audit_output_type=file file: log records will be saved into the rotating log file. The name of the file set by server_audit_file_path variable. syslog: log records will be sent to the local syslogd daemon with the standard \\<syslog.h> API. The default value is ''file''.\n Command line: --server-audit-output-type=value\n Scope: Global\n Dynamic: Yes\n Data type: enum\n Default value: file\n Valid values: SYSLOG, FILE\n\nserver_audit_query_log_limit\n\n Description: Limit on the length of the query string in a record.\n Command line: --server-audit-query-log-limit=#\n Scope: Global\n Dynamic: Yes\n Data type: numeric\n Default value: 1024\n Range: 0 to 2147483647\n\nserver_audit_sync_log_file\n\n Description: Flushes the buffer to the log file.\\\n  While log records are in the buffer, they don''t appear in the log file. To write them out from the buffer, issue this statement:\\\n  SET GLOBAL server_audit_sync_log_file=1\n Command line: --server-audit-sync-log-file\n Scope: Global\n Dynamic: Yes\n Data type: N/A\n Default value: OFF\n Valid values: ON (or 1), OFF (or 0)\n Introduced: MariaDB 12.1\n Usage: See description\n\nserver_audit_syslog_facility\n\n Description: SYSLOG-mode variable. It defines the ''facility'' of the records that will be sent to the syslog. Later the log can be filtered by this parameter.\n Command line: --server-audit-syslog-facility=value\n Scope: Global\n Dynamic: Yes\n Data type: enum\n Default value: LOG_USER\n Valid values: LOG_USER, LOG_MAIL, LOG_DAEMON, LOG_AUTH, LOG_SYSLOG, LOG_LPR, LOG_NEWS, LOG_UUCP, LOG_CRON, LOG_AUTHPRIV, LOG_FTP, and LOG_LOCAL0–LOG_LOCAL7.\n\nserver_audit_syslog_ident\n\n Description: SYSLOG-mode variable. String value for the ''ident'' part of each syslog record. Default value is ''mysql-server_auditing''. New value becomes effective only after restarting the logging.\n Command line: --server-audit-syslog-ident=value\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: mysql-server_auditing\n\nserver_audit_syslog_info\n\n Description: SYSLOG-mode variable. The ''info'' string to be added to the syslog records. Can be changed any time.\n Command line: --server-audit-syslog-info=value\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: Empty string\n\nserver_audit_syslog_priority\n\n Description: SYSLOG-mode variable. Defines the priority of the log records for the syslogd.\n Command line: --server-audit-syslog-priority=value\n Scope: Global\n Dynamic: Yes\n Data type: enum\n Default value: LOG_INFO\n Valid values:LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG\n\nserver_audit_timestamp_format\n\n Description: A format string used to print the timestamp into the audit log messages. The format used is the same as DATE_FORMAT.\n Command line: --server-audit-timestamp-format=value\n Scope: Global\n Dynamic: Yes\n Data type: string\n Default value: %Y%m%d %H:%i:%s\n\nNotes on System Variables\n\naudit_file_buffer_size and server_audit_sync_log_file\n\nThe server audit plugin typically employs synchronous, per-event logging, causing performance bottlenecks. Individual file writes for each log entry can result in significant I/O overhead, especially in large database environments. As of MariaDB 12.1, two new variables were introduced to allow asynchronous logging, and more fine grained control over how audit log writes are handled. Using the server_audit_file_buffer_size setting (buffer size in bytes), you can configure an additional in-memory audit log buffer. When the size of the buffer exceeds the server_audit_file_buffer_size setting, the audit log is written to disk. Additionally, a manual on-demand audit log disk sync can be triggered by setting server_audit_sync_log_file to ON or 1.\n\nOptions\n\nserver_audit\n\n Description: Controls how the server should treat the plugin when the server starts up.\n   Valid values are:\n     OFF - Disables the plugin without removing it from the mysql.plugins table.\n     ON - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled.\n     FORCE - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error.\n     FORCE_PLUS_PERMANENT - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME or UNINSTALL PLUGIN while the server is running.\n   See MariaDB Audit Plugin - Installation: Prohibiting Uninstallation for more information.\n   See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.\n Command line: --server-audit=val\n Data Type: enumerated\n Default Value: ON\n* Valid Values: OFF, ON, FORCE, FORCE_PLUS_PERMANENT`\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-options-and-system-variables', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-options-and-system-variables');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (121, 5, 'Audit Plugin Overview', 'Description\n-----------\n\nMariaDB and MySQL are used in a broad range of environments, but if you needed to record user access to be in compliance with auditing regulations for your organization, you would previously have had to use other database solutions. To meet this need, though, MariaDB has developed the MariaDB Audit Plugin. Although the MariaDB Audit Plugin has some unique features available only for MariaDB, it can be used also with MySQL.\n\nBasically, the purpose of the MariaDB Audit Plugin is to log the server''s activity. For each client session, it records who connected to the server (i.e., user name and host), what queries were executed, and which tables were accessed and server variables that were changed. This information is stored in a rotating log file or it may be sent to the local syslogd.\n\nReview these pages for detailed documentation:\n\n Installation\n Configuration\n Log Settings\n Log Location & Rotation\n Log Format\n Status Variables\n System Variables\n\nTutorials\n\n Activating MariaDB Audit Log\\\n  by Jaykishan Mutkawoa, May 30, 2016\n Installing MariaDB Audit Plugin on Amazon RDS\\\n  Amazon RDS supports using the MariaDB Audit Plugin on MySQL and MariaDB database instances.\n\nBlog Posts\n\n MySQL Auditing with MariaDB Auditing Plugin\\\n  by Peter Zaitsev, February 15, 2016\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-overview', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-overview');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (122, 5, 'Audit Plugin Status Variables', 'Description\n-----------\n\nThere are a few status variables related to the MariaDB Audit Plugin, once it has been installed. These variables can be displayed using the SHOW STATUS statement like so:\n\n``sql\nSHOW STATUS LIKE ''server_audit%'';\n\n+----------------------------+------------------+\n| Variable_name              | Value            |\n+----------------------------+------------------+\n| Server_audit_active        | ON               |\n| Server_audit_current_log   | server_audit.log |\n| Server_audit_last_error    |                  |\n| Server_audit_writes_failed | 0                |\n+----------------------------+------------------+\n`\n\nStatus Variables\n\nBelow is a list of all status variables related to the Audit Plugin. These cannot be set: These are not to be confused with system variables, which can be set. See Server Status Variables for a complete list of status variables that can be viewed with the SHOW STATUS statement. See also the Full list of MariaDB options, system and status variables.\n\nServer_audit_active\n\n Description: If the auditing is actually working. It gets the ON value when the logging is successfully started. Then it can get the OFF value if the logging was stopped or log records can''t be properly stored due to file or syslog errors.\n Data Type: boolean\n\nServer_audit_current_log\n\n Description: The name of the logfile or the SYSLOG parameters that are in current use.\n Data Type: string\n\nServer_audit_last_error\n\n Description: If something went wrong with the logging here you can see the message.\n Data Type: string\n\nServer_audit_writes_failed\n\n Description: The number of log records since last logging-start that weren''t properly stored because of errors of any kind. The global value can be flushed by FLUSH STATUS.\n Data Type: numeric\n* Default Value: 0`\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-status-variables', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-status-variables');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (123, 5, 'Audit Plugin Versions', 'Description\n-----------\n\nBelow is a list of the releases of the MariaDB Audit Plugin, the most recent version first, and in which versions of MariaDB each plugin version was included.\n\n| MariaDB Community Audit Plugin Version                                                                                   | Introduced in MariaDB Community Server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 1.5.0                                                                                                                    | MariaDB 12.0.1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| 1.4.14                                                                                                                   | MariaDB 10.3.35, MariaDB 10.4.25, MariaDB 10.5.16, MariaDB 10.6.8, MariaDB 10.7.4                                                                                                                         |\n| 1.4.13                                                                                                                   | MariaDB 10.2.38, MariaDB 10.3.29, MariaDB 10.4.19, MariaDB 10.5.10                                                                                                                                                                                                                      |\n| 1.4.10                                                                                                                   | MariaDB 10.2.35, MariaDB 10.3.26, MariaDB 10.5.7                                                                                                                                                                                                                                                                                                                                      |\n| 1.4.7                                                                                                                    | MariaDB 10.1.41, MariaDB 10.2.26, MariaDB 10.3.17, MariaDB 10.4.7                                                                                                                                                                                                                        |\n| 1.4.5                                                                                                                    | MariaDB 10.2.24, MariaDB 10.3.15, MariaDB 10.4.5                                                                                                                                                                                                                                                                                                                                      |\n| 1.4.4                                                                                                                    | MariaDB 5.5.61, MariaDB 10.0.36, MariaDB 10.1.34, MariaDB 10.2.15, MariaDB 10.3.7, MariaDB 10.4.0 |\n| 1.4.0                                                                                                                    | MariaDB 5.5.48, MariaDB 10.0.24, MariaDB 10.1.11                                                                                                                                                                                                                                                                                                                                       |\n| 1.3.0                                                                                                                    | MariaDB 5.5.43, MariaDB 10.0.18, MariaDB 10.1.5                                                                                                                                                                                                                                                                                                                                         |\n| 1.2.0                                                                                                                    | MariaDB 5.5.42, MariaDB 10.0.17, MariaDB 10.1.4                                                                                                                                                                                                                                                                                                                                         |\n| 1.1.7 | MariaDB 5.5.38, MariaDB 10.0.11, MariaDB 10.1.0                                                                                                                                                                                                                                                                                                                                         |\n| 1.1.6 | MariaDB 5.5.37, MariaDB 10.0.10                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| 1.1.5 | MariaDB 10.0.09                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| 1.1.4 | MariaDB 5.5.36                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| 1.1.3 | MariaDB 5.5.34, MariaDB 10.0.7                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-versions', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-versions');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (124, 5, 'MariaDB Enterprise Audit', 'Description\n-----------\n\nWhile application design specifications and database configurations may intend specific limitations to be placed around access to data, audit mechanisms help confirm the effectiveness of these controls.\n\nMariaDB Enterprise Audit is a plugin that logs data access and database operations.\n\nAudit mechanisms are most effective when they produce a manageable quantity of output. MariaDB Enterprise Audit includes advanced filtering features to enable narrowly defining which information is logged.\n\nWhere audit mechanisms may only be effective when control parameters can also be audited, MariaDB Enterprise Audit implements logging of configuration changes.\n\nPlugin Conflict (MENT-316)\n\nThe MariaDB Enterprise Audit plugin (server_audit2.so) is incompatible with the older server_audit.so (v1) plugin. Running both can cause server instability or deadlocks.\n\n_If you are a new user: You can continue reading._\n\n_If you are migrating: You must remove the old v1 plugin. Please go directly to the_ _Upgrades_ _section for complete instructions._\n\nConfiguration Overview\n\nMariaDB Enterprise Audit is installed and loaded by default. If you are unsure whether it is loaded on your system, you can confirm that the plugin is loaded.\n\nTo use MariaDB Enterprise Audit, the plugin must be configured: Administrators must define Audit Filters to configure what MariaDB Enterprise Audit writes to the audit log.\n\nMariaDB Enterprise Audit supports two types of Audit Filters:\n\n| Audit Filter Type                                                        | Used For                                                                                         |\n| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |\n| Default Audit Filter | The Default Audit Filter is used for any user account that is not assigned a Named Audit Filter. |\n| Named Audit Filters   | Named Audit Filters are assigned to specific user accounts.                                      |\n\nAdministrators can define Audit Filters to audit log activity using multiple types of filters:\n\n| Filter Type                                                   | Used For                                                                                                                                                                                                                                                                                                     |\n| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| Event Filters    | Event Filters are used to enable or disable audit logging for specific types of operations performed by the user accounts assigned to the Audit Filter.                                                                                                                                                      |\n| Logging Filters | Logging Filters are used to enable or disable audit logging for the user accounts assigned to the Audit Filter.                                                                                                                                                                                              |\n| Object Filters  | Object Filters are used to enable or disable audit logging for specific databases or tables accessed by the user accounts assigned to the Audit Filter. Support for Object Filters was added in MariaDB Enterprise Server 10.6. Support for Object Filters was backported to ES 10.4.21-13 and ES 10.5.12-8. |\n\nAdministrators must start audit logging.\n\nGeneral Operation\n\nMariaDB Enterprise Audit performs audit logging during typical operations of MariaDB Enterprise Server:\n\n When a user connects, fails to connect, or disconnects, MariaDB Enterprise Audit will write a message to the audit log if the Audit Filter specifies the specific type of Connect Event.\n When a user executes a query, MariaDB Enterprise Audit will write a message to the audit log if the Audit Filter specifies the specific type of Query Event and if the queried objects are not excluded by Object Filters.\n When a query accesses a table, MariaDB Enterprise Audit will write a message to the audit log if the Audit Filter specifies the specific type of Table Event and if the table is not excluded by Object Filters.\n When a query modifies the MariaDB Enterprise Audit configuration, MariaDB Enterprise Audit will write a message to the audit log if the Audit Filter specifies the Audit Config Event.\n When a user''s Audit Filter contains a Logging Filter that disables audit logging, all audit logging for the user''s activity will be skipped.\n\nMariaDB Enterprise Audit writes audit log messages either to a dedicated audit log file or to the system log (syslog), depending on configuration.\n\nAudit log messages that correspond to a query are logged when the query completes. If a query is executed in a transaction, the audit log messages that correspond to the query are logged when the individual query completes, not when the transaction completes. If the query fails, the audit log message is logged at time of failure.\n\nAudit Log Considerations\n\nCare must be taken when logging data for audit to maintain alignment to business requirements. Concerns include:\n\n Queries should not be logged for tables containing Personally Identifiable Information (PII) or Sensitive PII (SPII) such as passwords, since audit log data is written unencrypted. Consider using Object Filters to exclude sensitive information from the audit log.\n Backup of audit data should be performed at least as frequently as database backups.\n Audit log data on database servers could be tampered with if the database server is compromised. Consider secure transmission of log data to a hardened and remote logging server.\n Where audit data is mission-critical, it should be subject to controls, data protection, data retention, and highly-available storage as are used for other mission-critical data.\n\nInstall the Audit Plugin\n\nMariaDB Enterprise Audit comes preinstalled with MariaDB Enterprise Server, so no manual installation is required.\n\nTo verify that the plugin is installed:\n\n1. Locate your server’s plugin directory.\n    When MariaDB Enterprise Server is running, you can find the directory by checking the value of the plugin_dir system variable.\n\n``sql\nSHOW GLOBAL VARIABLES\n   LIKE ''plugin_dir'';\n`\n\n`sql\n+---------------+--------------------------+\n| Variable_name | Value                    |\n+---------------+--------------------------+\n| plugin_dir    | /usr/lib64/mysql/plugin/ |\n+---------------+--------------------------+\n`\n\n2. Verify the server_audit2.so file—the shared library used by MariaDB Enterprise Audit—is present in your server’s plugin directory.\n\n`bash\n$ ls -l /usr/lib64/mysql/plugin/server_audit2.so\n`\n\n`bash\n-rwxr-xr-x. 1 root root 70432 Jul 15 19:03 /usr/lib64/mysql/plugin/server_audit2.so\n`\n\nMariaDB Enterprise Audit is bundled with all MariaDB Enterprise Server distributions (binary tarball, DEB/RPM package tarball, and DEB/RPM packages). If you do not see the server_audit2.so file, verify that MariaDB Enterprise Server has been installed correctly.\n\nLoad the Audit Plugin\n\nMariaDB Enterprise Audit is enabled through the mariadb-enterprise.cnf configuration file, which is included by default with MariaDB Enterprise Server. This means manual loading is usually not required.\n\nThe mariadb-enterprise.cnf file activates MariaDB Enterprise Audit by configuring the plugin-load-add and server-audit options.\n\n`ini\n-- Auditing - pre-load Plugin\nplugin-load-add=server_audit\nserver_audit=FORCE_PLUS_PERMANENT\n`\n\nIf your environment does not use mariadb-enterprise.cnf, you can enable MariaDB Enterprise Audit by adding the same options to your own configuration file.\n\nConfirm the Audit Plugin is Loaded\n\nTo verify that MariaDB Enterprise Audit is installed, check the information_schema.PLUGINS table.\n\n`sql\nSELECT PLUGIN_STATUS, PLUGIN_LIBRARY, PLUGIN_DESCRIPTION, LOAD_OPTION\nFROM information_schema.PLUGINS\nWHERE PLUGIN_NAME=''SERVER_AUDIT''\\G\n`\n\n`sql\n************************ 1. row ***********************\n     PLUGIN_STATUS: ACTIVE\n    PLUGIN_LIBRARY: server_audit2.so\nPLUGIN_DESCRIPTION: MariaDB Enterprise Audit\n       LOAD_OPTION: FORCE_PLUS_PERMANENT\n`\n\nMariaDB Enterprise Audit is enabled through the mariadb-enterprise.cnf configuration file, which is included by default in MariaDB Enterprise Server. If your results differ from the example output above, verify that the mariadb-enterprise.cnf file specifies the plugin-load-add and server-audit options.\n\nStart Audit Logging\n\nWhen MariaDB Enterprise Audit is installed and loaded, audit logging does not begin automatically. You must explicitly start it, either from the shell or through SQL.\n\n<table><thead><tr><th width="111">Interface</th><th width="207">Method</th><th>Benefits</th></tr></thead><tbody><tr><td>Shell</td><td><a href="mariadb-enterprise-audit.md#start-audit-logging-in-configuration-file">Configuration File</a></td><td>SQL access is not required SUPER privilege is not required Configuration file can be version controlled.</td></tr><tr><td>SQL</td><td><a href="mariadb-enterprise-audit.md#start-audit-logging-with-set-global">SET GLOBAL Statement</a></td><td>Server restart is not required.</td></tr></tbody></table>\n\nStart Audit Logging in Configuration File\n\nEnable audit logging with MariaDB Enterprise Audit by setting the server_audit_logging system variable in a configuration file. Alternatively, enable it dynamically with SET GLOBAL, which does not require a server restart.\n\nTo configure in a file:\n\n1\\. Set the server_audit_logging system variable in the configuration file.\n\n`ini\n[mariadb]\nserver_audit_logging = ON\n`\n\n2. Restart MariaDB Enterprise Server:\n\n`bash\n$ sudo systemctl restart mariadb\n`\n\nIf the server does not start, review the error log for details.\n\n3. To confirm that audit logging is running, check the value of the Server_audit_active status variable using the SHOW GLOBAL STATUS statement.\n\n`sql\nSHOW GLOBAL STATUS\n   LIKE ''Server_audit_active'';\n`\n\n`sql\n+---------------------+-------+\n| Variable_name       | Value |\n+---------------------+-------+\n| Server_audit_active | ON    |\n+---------------------+-------+\n`\n\nStart Audit Logging with SET GLOBAL\n\nAudit logging with MariaDB Enterprise Audit can be started by setting the server_audit_logging system variable with the SET GLOBAL statement, which requires the SUPER privilege.\n\n1. Set the server_audit_logging system variable with the SET GLOBAL statement:\n\n`sql\nSET GLOBAL server_audit_logging=ON;\n`\n\n2. Confirm that audit logging is started by querying the Server_audit_active status variable with the SHOW GLOBAL STATUS statement:\n\n`sql\nSHOW GLOBAL STATUS\n   LIKE ''Server_audit_active'';\n`\n\n`sql\n+---------------------+-------+\n| Variable_name       | Value |\n+---------------------+-------+\n| Server_audit_active | ON    |\n+---------------------+-------+\n`\n\nWhen you modify a system variable dynamically using the SET GLOBAL statement, the change is not preserved after a server restart. To ensure audit logging automatically starts with the server, also configure the server_audit_logging system variable in a configuration file.\n\n`ini\n[mariadb]\nserver_audit_logging = ON\n`\n\nConfirm Audit Logging is Started\n\nConfirm that audit logging is started by querying the Server_audit_active status variable with the SHOW GLOBAL STATUS statement:\n\n`sql\nSHOW GLOBAL STATUS\n   LIKE ''Server_audit_active'';\n`\n\n`sql\n+---------------------+-------+\n| Variable_name       | Value |\n+---------------------+-------+\n| Server_audit_active | ON    |\n+---------------------+-------+\n`\n\nAudit Logging Buffer Writes\n\nBuffer writes are available from MariaDB Enterprise Server 11.8.\n\nAudit log buffering is controlled by these variables:\n\n server_audit_file_buffer_size — This defines the size of the buffer. The default value is 0, meaning there''s no buffering at all. Setting non-zero value enables the buffering with the buffer of the specified size aligned by 8192. The maximum value is 65536.\n server_audit_sync_log_file — This flushes the buffer to the log file. While the log record is in the buffer, it cannot be seen in the log file. If there aren''t many events to log, the time before records can be observed can be significant. You can issue this statement to force writing the buffer to the file, making sure not to miss recent records:\n\n`sql\nSET GLOBAL server_audit_log_file=1\n`\n\nForbid Uninstallation\n\nIn a secure environment, MariaDB Enterprise Audit provides administrators with an audit trail of actions performed by users on the MariaDB Enterprise Server node. To protect the integrity of the audit trail, users should not be able to uninstall MariaDB Enterprise Audit. If the server-audit option is set to FORCE_PLUS_PERMANENT, MariaDB Enterprise Server will prevent MariaDB Enterprise Audit from being uninstalled:\n\n`ini\nserver_audit=FORCE_PLUS_PERMANENT\n`\n\nWhen a user tries to uninstall MariaDB Enterprise Audit with the server-audit option set to FORCE_PLUS_PERMANENT, the operation fails with the ER_PLUGIN_IS_PERMANENT error code:\n\n`sql\nUNINSTALL SONAME ''server_audit2'';\n`\n\n`sql\nERROR 1702 (HY000): Plugin ''SERVER_AUDIT'' is force_plus_permanent and can not be unloaded\n`\n\nThe mariadb-enterprise.cnf configuration file included by default in MariaDB Enterprise Server sets the server-audit option to FORCE_PLUS_PERMANENT. As a consequence, MariaDB Enterprise Server forbids MariaDB Enterprise Audit from being uninstalled by default.\n\nIf you do not use mariadb-enterprise.cnf in your environment, you can configure MariaDB Enterprise Audit to forbid uninstallation by setting the server-audit option in your configuration file.\n\nConfirm that Uninstallation is Forbidden\n\nTo confirm that MariaDB Enterprise Audit is configured to forbid uninstallation, query the information_schema.PLUGINS table:\n\n`sql\nSELECT PLUGIN_STATUS, PLUGIN_LIBRARY, PLUGIN_DESCRIPTION, LOAD_OPTION\nFROM information_schema.PLUGINS\nWHERE PLUGIN_NAME=''SERVER_AUDIT''\\G\n`\n\n`sql\n*********************** 1. row ***********************\n     PLUGIN_STATUS: ACTIVE\n    PLUGIN_LIBRARY: server_audit2.so\nPLUGIN_DESCRIPTION: MariaDB Enterprise Audit\n       LOAD_OPTION: FORCE_PLUS_PERMANENT\n`\n\nIf your output does not match the example output shown above, confirm that the mariadb-enterprise.cnf configuration file sets the server-audit option to FORCE_PLUS_PERMANENT.\n\nServer Startup Behavior\n\nSome specific server startup behavior is described in the sections below.\n\nFor examples of error messages that can appear in the MariaDB error log during server startup, see Messages\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-enterprise-audit');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (125, 5, 'WSREP\\_INFO Plugin', 'Description\n-----------\n\nThe WSREP_INFO plugin library contains the following plugins:\n\n WSREP_MEMBERSHIP\n WSREP_STATUS\n\nThe WSREP_MEMBERSHIP plugin creates the WSREP_MEMBERSHIP table in the INFORMATION_SCHEMA database. The plugin also adds the SHOW WSREP_MEMBERSHIP statement.\n\nThe WSREP_STATUS plugin creates the WSREP_STATUS table in the INFORMATION_SCHEMA database. The plugin also adds the SHOW WSREP_STATUS statement.\n\nThese tables and statements provide information about Galera. Only users with the SUPER privilege can access this information.\n\nInstalling the Plugin\n\niAlthough the plugin''s shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n``sql\nINSTALL SONAME ''wsrep_info'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mysqld or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = wsrep_info\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME ''wsrep_info'';\n``\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nExamples\n--------\n\nSHOW TABLES FROM information_schema LIKE ''WSREP%'';\n+---------------------------------------+\n| Tables_in_information_schema (WSREP%) |\n+---------------------------------------+\n| WSREP_STATUS                          |\n| WSREP_MEMBERSHIP                      |\n+---------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-replication-cluster-plugins/wsrep_info-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-replication-cluster-plugins/wsrep_info-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (126, 5, 'wsrep\\_provider', 'Description\n-----------\n\nThis plugin is for Galera Cluster. It splits up the wsrep_provider_options setting into individual configuration variables.\n\nThe plugin is available from MariaDB 11.4, and built in to the server, but not enabled by default.\n\nWithout that plugin, options are grouped together, like this:\n\n``ini\nwsrep_provider_options="base_dir = /var/lib/mysql/; base_host = node-1;..."\n`\n\nWith this plugin loaded, you can configure individual variables, like this:\n\n`ini\nwsrep_provider_base_dir  = /var/lib/mysql/\nwsrep_provider_base_host = node-1\n...\n`\n\nThis makes managing provider options easier, and helps avoid the problem of wsrep_provider_options exceeding the maximum length of 2048 characters for an individual variable.\n\nTo enable the plugin, add the following line to the [mariadbd], [server], or [galera] sections of your server option file:\n\n`ini\nplugin-wsrep-provider=ON\n`\n\nAlternatively, start the server with the --plugin-wsrep-provider` option.\n\nSee the wsrep_provider_options page for what you can configure for Galera Cluster.\n\nFor plugin version and maturity level, see this page.\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-replication-cluster-plugins/wsrep_provider', '', 'https://mariadb.com/docs/server/reference/plugins/mariadb-replication-cluster-plugins/wsrep_provider');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (127, 5, 'Disks Plugin', 'Description\n-----------\n\nThe DISKS plugin creates the DISKS table in the INFORMATION_SCHEMA database. This table shows metadata about disks on the system, enabling monitoring of the disk space status. Accessing the INFORMATION_SCHEMA.DISKS table requires the FILE privilege.\n\nThe plugin is supported on Linux systems only.\n\nInstalling the Plugin\n\nAlthough the plugin''s shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB automatically. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n``sql\nINSTALL SONAME ''disks'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be provided as a command-line argument to mysqld or specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = disks\n``\n\nExamples\n--------\n\n  +-----------+-----------------------+-----------+----------+-----------+\n  | Disk      | Path                  | Total     | Used     | Available |\n  +-----------+-----------------------+-----------+----------+-----------+\n  | /dev/sda3 | /                     |  47929956 | 30666304 |  14805864 |\n  | /dev/sda1 | /boot/efi             |    191551 |     3461 |    188090 |\n  | /dev/sda4 | /home                 | 174679768 | 80335392 |  85448120 |\n  | /dev/sdb1 | /mnt/hdd              | 961301832 |    83764 | 912363644 |\n  | /dev/sdb1 | /home/wikman/Music    | 961301832 |    83764 | 912363644 |\n  | /dev/sdb1 | /home/wikman/Videos   | 961301832 |    83764 | 912363644 |\n  | /dev/sdb1 | /home/wikman/hdd      | 961301832 |    83764 | 912363644 |\n  | /dev/sdb1 | /home/wikman/Pictures | 961301832 |    83764 | 912363644 |\n  | /dev/sda3 | /var/lib/docker/aufs  |  47929956 | 30666304 |  14805864 |\n  +-----------+-----------------------+-----------+----------+-----------+\n  9 rows in set (0.00 sec)\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/disks-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/disks-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (128, 5, 'Feedback Plugin', 'Description\n-----------\n\nThe feedback plugin is designed to collect and, optionally, upload\\\nconfiguration and usage information to MariaDB.org or to any other configured URL.\n\nSee the MariaDB User Feedback page on MariaDB.org to see collected MariaDB usage statistics.\n\nMariaDB is usually distributed with this plugin included, but it is not enabled by default.\\\nOn Windows, this plugin is part of the server and has a special checkbox in the installer window. Either way, you need to explicitly install and enable it in order for feedback data to be sent.\n\nVerifying the Plugin''s Status\n\nTo verify whether the feedback plugin is installed and enabled, execute the SHOW PLUGINS statement or query the information_schema.plugins table:\n\n``sql\nSELECT plugin_status FROM information_schema.plugins \n  WHERE plugin_name = ''feedback'';\n+---------------+\n| plugin_status |\n+---------------+\n| DISABLED      |\n+---------------+\n`\n\nIf that SELECT returns no rows, then you still need to install the plugin.\n\nWhen the plugin is installed and enabled, you will see:\n\n`sql\nSELECT plugin_status FROM information_schema.plugins \n  WHERE plugin_name = ''feedback'';\n+---------------+\n| plugin_status |\n+---------------+\n| ACTIVE        |\n+---------------+\n`\n\nInstalling the Plugin\n\nIn some releases, the plugin''s shared library is distributed with MariaDB by default, but the plugin is not actually installed by MariaDB. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n`\nINSTALL SONAME ''feedback'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mariadbd, or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = feedback\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME ''feedback'';\n`\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nEnabling the Plugin\n\nYou can enable the plugin by setting the feedback option to ON in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nfeedback=ON\n`\n\nIn Windows, the plugin can also be enabled during a new MSI installation. The MSI GUI installation provides the "Enable feedback plugin" checkbox to enable the plugin. The MSI command-line installation provides the FEEDBACK=1 command-line option to enable the plugin.\n\nSee the next section for how to verify the plugin is installed and active and (if needed) install the plugin.\n\nCollecting Data\n\nThe feedback plugin collects the following data:\n\n Certain rows from SHOW STATUS and SHOW VARIABLES.\n All installed plugins and their versions.\n System information such as CPU count, memory, architecture, and OS/linux distribution.\n The feedback_server_uid, which is a SHA1 hash of the MAC address of the first network interface and the TCP port that the server listens on.\n\nThe feedback plugin creates the FEEDBACK table in the INFORMATION_SCHEMA database. To see the data that has been collected by the plugin, you can execute:\n\n`sql\nSELECT  FROM information_schema.feedback;\n`\n\nOnly the contents of this table are sent to the feedback_url.\n\nMariaDB stores collation usage statistics. Each collation that has been used by the server\\\nwill have a record in output of SELECT  FROM information_schema.feedback , for example:\n\n`\n+----------------------------------------+---------------------+\n| VARIABLE_NAME                          | VARIABLE_VALUE      |\n+----------------------------------------+---------------------+\n| Collation used utf8_unicode_ci         | 10                  |\n| Collation used latin1_general_ci       | 20                  |\n+----------------------------------------+---------------------+\n`\n\nCollations that have not been used will not be included in the result.\n\nSending Data\n\nThe feedback plugin sends the data using a POST request to any URL or a list of URLs\\\nthat you specify by setting the feedback_url system variable. By default, this is set to the following URL:\n\n https://feedback.mariadb.org/rest/v1/post\n\nBoth HTTP and HTTPS protocols are supported.\n\nIf HTTP traffic requires a proxy in your environment, then you can specify the proxy by setting the feedback_http_proxy system variable.\n\nIf the feedback_url system variable is not set to an empty string, then the\\\nplugin will automatically send a report to all URLs in the list a few minutes after the server starts up and then once a week after that.\n\nIf the feedback_url system variable is set to an empty string, then the\\\nplugin will not automatically send any data. This may be necessary if outbound HTTP communication from your database server is not permitted. In this case, you can still upload the data manually, if you''d like.\n\nFirst, generate the report file with the MariaDB command-line mariadb client:\n\n`bash\n$ mariadb -e ''select  from information_schema.feedback'' > report.txt\n`\n\nThen, you can upload the generated report.txt here from the command line with tools such as curl:\n\n`bash\n$ curl -F data=@report.txt https://feedback.mariadb.org/rest/v1/post\n`\n\nManual uploading allows you to be absolutely sure that we receive only the data shown in the INFORMATION_SCHEMA.FEEDBACK table and that no private or sensitive information is being sent.\n\nSystem Variables\n\nfeedback_http_proxy\n\n Description: Proxy server for use when http calls cannot be made, such as in a firewall environment. The format is host:port.\n Command line: --feedback-http=proxy=value\n Read-only: Yes\n Data Type: string\n Default Value: '''' (empty)\n\nfeedback_send_retry_wait\n\n Description: Time in seconds before retrying if the plugin failed to send the data for any reason.\n Command line: --feedback-send-retry-wait=#\n Scope: Global\n Dynamic: Yes\n Data Type: numeric\n Default Value: 60\n Valid Values: 1 to 86400\n\nfeedback_send_timeout\n\n Description: An attempt to send the data times out and fails after this many seconds.\n Command line: --feedback-send-timeout=#\n Scope: Global\n Dynamic: Yes\n Data Type: numeric\n Default Value: 60\n Valid Values: 1 to 86400\n\nfeedback_server_uid\n\n Description: Automatically calculated server unique id hash.\n Scope: Global\n Dynamic: No\n Data Type: string\n\nfeedback_url\n\n Description: URL to which the data is sent. More than one URL, separated by spaces, can be specified. Set it to an empty string to disable data sending.\n Command line: --feedback-url=url\n Scope: Global\n Dynamic: No\n Data Type: string\n Default Value: https://feedback.mariadb.org/rest/v1/post\n\nfeedback_user_info\n\n Description: The value of this option is not used by the plugin, but it is included in the feedback data. It can be used to add any user-specified string to the report. This could be used to help to identify it. For example, a support contract number, or a computer name (if you collect reports internally by specifying your own feedback-url).\n Command line: --feedback-user-info=string\n Scope: Global\n Dynamic: No\n Data Type: string\n Default Value: Empty string\n\nOptions\n\nfeedback\n\n Description: Controls how the server should treat the plugin when the server starts up.\n   Valid values are:\n     OFF - Disables the plugin without removing it from the mysql.plugins table.\n     ON - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled.\n     FORCE - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error.\n     FORCE_PLUS_PERMANENT - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME or UNINSTALL PLUGIN while the server is running.\n   See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.\n Command line: --feedback=value\n Data Type: enumerated\n Default Value: ON\n Valid Values: OFF, ON, FORCE, FORCE_PLUS_PERMANENT`\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/feedback-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/feedback-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (129, 5, 'METADATA\\_LOCK\\_INFO Plugin', 'Description\n-----------\n\nThe METADATA_LOCK_INFO plugin creates the METADATA_LOCK_INFO table in the INFORMATION_SCHEMA database. This table shows active metadata locks. The table is empty if there are no active metadata locks.\n\nInstalling the Plugin\n\nAlthough the plugin''s shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n``sql\nINSTALL SONAME ''metadata_lock_info'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mysqld or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = metadata_lock_info\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME ''metadata_lock_info'';\n``\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nExamples\n--------\n\nSELECT * FROM information_schema.metadata_lock_info;  \n+-----------+--------------------------+---------------+----------------------+-----------------+-------------+\n| THREAD_ID | LOCK_MODE                | LOCK_DURATION | LOCK_TYPE            | TABLE_SCHEMA    | TABLE_NAME  |  \n+-----------+--------------------------+---------------+----------------------+-----------------+-------------+\n|        31 | MDL_INTENTION_EXCLUSIVE  | MDL_EXPLICIT  | Global read lock     |                 |             |  \n|        31 | MDL_INTENTION_EXCLUSIVE  | MDL_EXPLICIT  | Commit lock          |                 |             |\n|        31 | MDL_INTENTION_EXCLUSIVE  | MDL_EXPLICIT  | Schema metadata lock | dbname          |             |\n|        31 | MDL_SHARED_NO_READ_WRITE | MDL_EXPLICIT  | Table metadata lock  | dbname          | exotics     |\n+-----------+--------------------------+---------------+----------------------+-----------------+-------------+\n4 rows in set (0.00 sec)\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/metadata-lock-info-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/metadata-lock-info-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (130, 5, 'mhnsw', 'Description\n-----------\n\nThis plugin is for internal use only.\n\nThis plugin implements the nhnsw vector index algorithm. It is used to create vector indexes.\n\nSee Vector Overview for the functionality, and Vector System Variables for what you can configure.\n\nIt is built in the server, and is always enabled.\n\nFor plugin version and maturity level, see this page.\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/mhnsw', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/mhnsw');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (131, 5, 'MYSQL\\_JSON', 'Description\n-----------\n\nThe TYPE_MYSQL_JSON plugin is available from MariaDB 10.5.7.\n\nThe JSON type in MySQL stores the JSON object in its own native form, while, in MariaDB, the JSON type is a LONGTEXT. Opening a table with a JSON type created in MySQL results in an error:\n\n``sql\nSELECT * FROM mysql_json_table;\nERROR 4161 (HY000): Unknown data type: ''MYSQL_JSON''\n`\n\nThe mysql_json plugin is used to make it easier to upgrade to MariaDB.\n\nInstalling\n\nInstalling can be done in a number of ways, for example:\n\n`sql\nINSTALL SONAME ''type_mysql_json'';\n``\n\nSee Making MariaDB understand MySQL JSON for a full description.\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/mysql_json', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/mysql_json');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (132, 5, 'online\\_alter\\_log', 'Description\n-----------\n\nThis plugin is for internal use only.\n\nThis plugin represents the online alter log in a transaction. It is used to commit transactions for tables while an online ALTER TABLE query is running.\n\nIt is built in the server, and is always enabled.\n\nSee the Online Schema Change page for functionality details.\n\nFor plugin version and maturity level, see this page.\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/online_alter_log', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/online_alter_log');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (133, 5, 'Query Cache Information Plugin', 'Description\n-----------\n\nThe QUERY_CACHE_INFO plugin creates the QUERY_CACHE_INFO table in the INFORMATION_SCHEMA database. This table shows all queries in the query cache. Querying this table acquires the query cache lock and will result in lock waits for queries that are using or expiring from the query cache. You must have the PROCESS privilege to query this table.\n\nInstalling the Plugin\n\nAlthough the plugin''s shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n``sql\nINSTALL SONAME ''query_cache_info'';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mysqld or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = query_cache_info\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME ''query_cache_info'';\n``\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nExamples\n--------\n\nSELECT statement_schema, statement_text, result_blocks_count, \n  result_blocks_size FROM information_schema.query_cache_info;\n+------------------+------------------+---------------------+--------------------+\n| statement_schema | statement_text   | result_blocks_count | result_blocks_size |\n+------------------+------------------+---------------------+--------------------+\n| test             | SELECT * FROM t1 |                   1 |                512 |\n+------------------+------------------+---------------------+--------------------+\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/query-cache-information-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/query-cache-information-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (134, 5, 'Query Response Time Plugin', 'Description\n-----------\n\nThe query_response_time plugin creates the QUERY_RESPONSE_TIME table in the INFORMATION_SCHEMA database. The plugin also adds the SHOW QUERY_RESPONSE_TIME and FLUSH QUERY_RESPONSE_TIME statements.\n\nThe slow query log provides exact information about queries that take a long time to execute. However, sometimes there are a large number of queries that each take a very short amount of time to execute. This feature provides a tool for analyzing that information by counting and displaying the number of queries according to the length of time they took to execute.\n\nThis feature is based on Percona''s Response Time Distribution.\n\nInstalling the Plugin\n\nThis shared library actually consists of a number of different plugins:\n\n QUERY_RESPONSE_TIME - An INFORMATION_SCHEMA plugin that exposes statistics.\n QUERY_RESPONSE_TIME_AUDIT - audit plugin, collects statistics.\n\nBoth plugins need to be installed to get meaningful statistics.\n\nIn addition, these additional plugins are available:\n\n QUERY_RESPONSE_TIME_READ\n QUERY_RESPONSE_TIME_READ_WRITE\n QUERY_RESPONSE_TIME_WRITE\n\nThis shared library actually consists of a number of different plugins:\n\n QUERY_RESPONSE_TIME - An INFORMATION_SCHEMA plugin that exposes statistics.\n QUERY_RESPONSE_TIME_AUDIT - audit plugin, collects statistics.\n\nBoth plugins need to be installed to get meaningful statistics.\n\nAlthough the plugin''s shared library is distributed with MariaDB by default, the plugins are not actually installed by MariaDB by default. There are two methods that can be used to install the plugins with MariaDB.\n\nThe first method can be used to install the plugin library without restarting the server. You can install the plugins dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n``sql\nINSTALL SONAME ''query_response_time'';\n`\n\nThe second method can be used to tell the server to load the plugin library when it starts up. The plugins can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mysqld or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = query_response_time\n`\n\nNote that in both cases you have to activate data collection by changing the query_response_time_stats setting to ON, it is OFF by default even when the plugin library is loaded.\n\nYou can change the setting at runtime with\n\n`sql\nSET GLOBAL query_response_time_stats=ON;\n`\n\nor in the options file after the plugin has been loaded:\n\n`ini\n[mariadb]\n...\nplugin_load_add = query_response_time\nquery_response_time_stats=ON;\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME ''query_response_time'';\n`\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nResponse Time Distribution\n\nThe user can define time intervals that divide the range 0 to positive infinity into smaller intervals and then collect the number of commands whose execution times fall into each of those intervals.\n\nEach interval is described as:\n\n`\n(range_base ^ n; range_base ^ (n+1)]\n`\n\nThe range_base is some positive number (see Limitations). The interval is defined as the difference between two nearby powers of the range base.\n\nIf the range base equals 10, we have the following intervals:\n\n`\n(0; 10 ^ -6], (10 ^ -6; 10 ^ -5], (10 ^ -5; 10 ^ -4], ..., \n  (10 ^ -1; 10 ^1], (10^1; 10^2]...(10^7; positive infinity]\n`\n\nor\n\n`\n(0; 0.000001], (0.000001; 0.000010], (0.000010; 0.000100], ..., \n  (0.100000; 1.0]; (1.0; 10.0]...(1000000; positive infinity]\n`\n\nFor each interval, a count is made of the queries with execution times that fell into that interval.\n\nYou can select the range of the intervals by changing the range base. For example, for base range=2 we have the following intervals:\n\n`\n(0; 2 ^ -19], (2 ^ -19; 2 ^ -18], (2 ^ -18; 2 ^ -17], ..., \n  (2 ^ -1; 2 ^1], (2 ^ 1; 2 ^ 2]...(2 ^ 25; positive infinity]\n`\n\nor\n\n`\n(0; 0.000001], (0.000001, 0.000003], ..., \n  (0.25; 0.5], (0.5; 2], (2; 4]...(8388608; positive infinity]\n`\n\nSmall numbers look strange (i.e., don’t look like powers of 2), because we lose precision on division when the ranges are calculated at runtime. In the resulting table, you look at the high boundary of the range:\n\n`sql\nSELECT  FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;\n+----------------+-------+----------------+\n| TIME           | COUNT | TOTAL          |\n+----------------+-------+----------------+\n|       0.000001 |     0 |       0.000000 |\n|       0.000010 |    17 |       0.000094 |\n|       0.000100 |  4301         0.236555 |\n|       0.001000 |  1499 |       0.824450 |\n|       0.010000 | 14851 |      81.680502 |\n|       0.100000 |  8066 |     443.635693 |\n|       1.000000 |     0 |       0.000000 |\n|      10.000000 |     0 |       0.000000 |\n|     100.000000 |     1 |      55.937094 |\n|    1000.000000 |     0 |       0.000000 |\n|   10000.000000 |     0 |       0.000000 |\n|  100000.000000 |     0 |       0.000000 |\n| 1000000.000000 |     0 |       0.000000 |\n| TOO LONG       |     0 | TOO LONG       |\n+----------------+-------+----------------+\n`\n\nThis means there were:\n\n`\n 17 queries with 0.000001 < query execution time < = 0.000010 seconds; total execution time of the 17 queries = 0.000094 seconds\n\n 4301 queries with 0.000010 < query execution time < = 0.000100 seconds; total execution time of the 4301 queries = 0.236555 seconds\n\n 1499 queries with 0.000100 < query execution time < = 0.001000 seconds; total execution time of the 1499 queries = 0.824450 seconds\n\n 14851 queries with 0.001000 < query execution time < = 0.010000 seconds; total execution time of the 14851 queries = 81.680502 seconds\n\n 8066 queries with 0.010000 < query execution time < = 0.100000 seconds; total execution time of the 8066 queries = 443.635693 seconds\n\n 1 query with 10.000000 < query execution time < = 100.0000 seconds; total execution time of the 1 query = 55.937094 seconds\n`\n\nUsing the Plugin\n\nUsing the Information Schema Table\n\nYou can get the distribution by querying the QUERY_RESPONSE_TIME table in the INFORMATION_SCHEMA database:\n\n`sql\nSELECT  FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;\n`\n\nYou can also write more complex queries:\n\n`sql\nSELECT c.count, c.time,\n(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME AS a \n   WHERE a.count != 0) AS query_count,\n(SELECT COUNT()     FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME AS b \n  WHERE b.count != 0) AS not_zero_region_count,\n(SELECT COUNT()     FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) AS region_count\nFROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME AS c \n  WHERE c.count > 0;\n`\n\nNote: If query_response_time_stats is set to ON, then the execution times for these two SELECT queries will also be collected.\n\nUsing the SHOW Statement\n\nAs an alternative to the QUERY_RESPONSE_TIME table in the INFORMATION_SCHEMA database, you can also use the SHOW QUERY_RESPONSE_TIME statement:\n\n`sql\nSHOW QUERY_RESPONSE_TIME;\n`\n\nFlushing Plugin Data\n\nFlushing the plugin data does two things:\n\n Clears the collected times from the QUERY_RESPONSE_TIME table in the INFORMATION_SCHEMA database.\n Reads the value of query_response_time_range_base and uses it to set the range base for the table.\n\nPlugin data can be flushed with the FLUSH QUERY_RESPONSE_TIME statement:\n\n`sql\nFLUSH QUERY_RESPONSE_TIME;\n`\n\nSetting the query_response_time_flush system variable has the same effect:\n\n`sql\nSET GLOBAL query_response_time_flush=1;\n`\n\nIt is possible to specify flushing read and/or write statements with the FLUSH QUERY_RESPONSE_TIME_READ, FLUSH QUERY_RESPONSE_TIME_WRITE and FLUSH QUERY_RESPONSE_TIME_READ_WRITE statements.\n\nIt is not possible to specify flushing read and/or write statements with the FLUSH QUERY_RESPONSE_TIME_READ, FLUSH QUERY_RESPONSE_TIME_WRITE and FLUSH QUERY_RESPONSE_TIME_READ_WRITE statements.\n\nSystem Variables\n\nquery_response_time_flush\n\n Description: Updating this variable flushes the statistics and re-reads query_response_time_range_base.\n Command line: None\n Scope: Global\n Dynamic: Yes\n Data Type: boolean\n Default Value: OFF\n\nquery_response_time_range_base\n\n Description: Select base of log for QUERY_RESPONSE_TIME ranges. WARNING: variable change takes affect only after flush.\n Command line: --query-response-time-range-base=#\n Scope: Global\n Dynamic: Yes\n Data Type: numeric\n Default Value: 10\n Range: 2 to 1000\n\nquery_response_time_exec_time_debug\n\n Description: Pretend queries take this many microseconds. When 0 (the default) use the actual execution time.\n   This system variable is only available when the plugin is a debug build.\n Scope: Global\n Dynamic: Yes\n Data Type: numeric\n Default Value: 0\n Range: 0 to 31536000\n\nquery_response_time_session_stats\n\n Description: Controls query response time statistics collection for the current session: ON - enable, OFF - disable, GLOBAL (default) - use query_response_time_stats value.\n Command line: query-response-time-session-stats=val]\n Scope: Global, Session\n Dynamic: Yes\n Data Type: enum\n Default Value: GLOBAL\n Valid Values: GLOBAL, ON, OFF\n Introduced: MariaDB 11.5\n\nquery_response_time_stats\n\n Description: Enable or disable query response time statistics collecting.\n Command line: query-response-time-stats[={0|1}]\n Scope: Global\n Dynamic: Yes\n Data Type: boolean\n Default Value: OFF\n\nOptions\n\nquery_response_time\n\n Description: Controls how the server should treat the plugin when the server starts up.\n   Valid values are:\n     OFF - Disables the plugin without removing it from the mysql.plugins table.\n     ON - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled.\n     FORCE - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error.\n     FORCE_PLUS_PERMANENT - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME or UNINSTALL PLUGIN while the server is running.\n   See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.\n Command line: --query-response-time=value\n Data Type: enumerated\n Default Value: ON\n Valid Values: OFF, ON, FORCE, FORCE_PLUS_PERMANENT\n\nquery_response_time_audit\n\n Description: Controls how the server should treat the plugin when the server starts up.\n   Valid values are:\n     OFF - Disables the plugin without removing it from the mysql.plugins table.\n     ON - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled.\n     FORCE - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error.\n     FORCE_PLUS_PERMANENT - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME or UNINSTALL PLUGIN while the server is running.\n   See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.\n Command line: --query-response-time-audit=value\n Data Type: enumerated\n Default Value: ON\n* Valid Values: OFF, ON, FORCE, FORCE_PLUS_PERMANENT`\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/query-response-time-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/query-response-time-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (135, 5, 'User Variables Plugin', 'Description\n-----------\n\nThe user_variables plugin creates the USER_VARIABLES table in the INFORMATION_SCHEMA database. This table contains information about user-defined variables.\n\nViewing\n\nUser-defined variables can be viewed by either querying the USER_VARIABLES, or by running SHOW USER_VARIABLES.\n\nFlushing User-Defined Variables\n\nUser-defined variables are reset and the Information Schema table emptied with the FLUSH USER_VARIABLES statement.\n\nExamples\n--------\n\nSET @v1 = 0;\nSET @v2 = ''abc'';\nSET @v3 = CAST(123 AS CHAR(5));\n\nSHOW USER_VARIABLES;\n+---------------+-------+\n| Variable_name | Value |\n+---------------+-------+\n| v3            | 123   |\n| v2            | abc   |\n| v1            | 0     |\n+---------------+-------+\n\nSELECT  FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME;\n+---------------+----------------+---------------+--------------------+\n| VARIABLE_NAME | VARIABLE_VALUE | VARIABLE_TYPE | CHARACTER_SET_NAME |\n+---------------+----------------+---------------+--------------------+\n| v1            | 0              | INT           | latin1             |\n| v2            | abc            | VARCHAR       | utf8               |\n| v3            | 123            | VARCHAR       | utf8               |\n+---------------+----------------+---------------+--------------------+\n\nFLUSH USER_VARIABLES;\n\nSELECT  FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME;\nEmpty set (0.000 sec)\n\nURL: https://mariadb.com/docs/server/reference/plugins/other-plugins/user-variables-plugin', '', 'https://mariadb.com/docs/server/reference/plugins/other-plugins/user-variables-plugin');



INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (139, 5, 'password\\_reuse\\_check\\_interval Variable', 'Description\n-----------\n\nThe password_reuse_check_interval system variable is available when the password_reuse_check plugin is installed. It determines the retention period for the password history in days. Zero, the default, means that passwords are never discarded.\n\n Command line: --password_reuse_check_interval=#\n Scope: Global\n Read-only: No\n Data Type: numeric\n Default Value: 0\n Range: 0 to 36500\n\nURL: https://mariadb.com/docs/server/reference/plugins/password-validation-plugins/password_reuse_check_interval', '', 'https://mariadb.com/docs/server/reference/plugins/password-validation-plugins/password_reuse_check_interval');

INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (141, 5, 'Plugin Overview', 'Description\n-----------\n\nMariaDB supports the use of plugins, software components that may be added to the core software without having to rebuild the MariaDB server from source code. Plugins can be loaded at startup, or loaded and unloaded while the server is running, without interruption. Plugins are commonly used for adding desired storage engines, additional security requirements, logging special information about the server, or even small enhancements, such as a plugin to get a timestamp as an integer.\n\nQuerying Plugin Information\n\nThere are a number of ways to see which plugins are currently active.\n\nA server almost always has a large number of active plugins, because the server contains a large number of built-in plugins, which are active by default and cannot be uninstalled.\n\nQuerying Plugin Information with SHOW PLUGINS\n\nThe SHOW PLUGINS statement can be used to query information about all active plugins.\n\nFor example:\n\n``sql\nSHOW PLUGINS\\G;\n******************* 1. row ****************\n   Name: binlog\n Status: ACTIVE\n   Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n**************** 2. row ****************\n   Name: mysql_native_password\n Status: ACTIVE\n   Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n**************** 3. row ******************\n   Name: mysql_old_password\n Status: ACTIVE\n   Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n...\n`\n\nIf a plugin''s Library column has a NULL value, then the plugin is built-in, and it cannot be uninstalled.\n\nQuerying Plugin Information with information_schema.PLUGINS\n\nThe information_schema.PLUGINS table can be queried to get more detailed information about plugins.\n\nFor example:\n\n`sql\nSELECT  FROM information_schema.PLUGINS\\G\n...\n************************ 65. row *********************\n           PLUGIN_NAME: user_variables\n        PLUGIN_VERSION: 1.0\n         PLUGIN_STATUS: ACTIVE\n           PLUGIN_TYPE: INFORMATION SCHEMA\n   PLUGIN_TYPE_VERSION: 110600.0\n        PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n         PLUGIN_AUTHOR: Sergey Vojtovich\n    PLUGIN_DESCRIPTION: User-defined variables\n        PLUGIN_LICENSE: GPL\n           LOAD_OPTION: ON\n       PLUGIN_MATURITY: Stable\n   PLUGIN_AUTH_VERSION: 1.0\n********************* 66. row *********************\n           PLUGIN_NAME: wsrep_provider\n        PLUGIN_VERSION: 1.0\n         PLUGIN_STATUS: ACTIVE\n           PLUGIN_TYPE: REPLICATION\n   PLUGIN_TYPE_VERSION: 2.0\n        PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n         PLUGIN_AUTHOR: Codership Oy\n    PLUGIN_DESCRIPTION: Wsrep provider plugin\n        PLUGIN_LICENSE: GPL\n           LOAD_OPTION: ON\n       PLUGIN_MATURITY: Alpha\n   PLUGIN_AUTH_VERSION: 1.0\n********************* 67. row ***********************\n           PLUGIN_NAME: THREAD_POOL_GROUPS\n        PLUGIN_VERSION: 1.0\n         PLUGIN_STATUS: ACTIVE\n           PLUGIN_TYPE: INFORMATION SCHEMA\n   PLUGIN_TYPE_VERSION: 110600.0\n        PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n         PLUGIN_AUTHOR: Vladislav Vaintroub\n    PLUGIN_DESCRIPTION: Provides information about threadpool groups.\n        PLUGIN_LICENSE: GPL\n           LOAD_OPTION: ON\n       PLUGIN_MATURITY: Stable\n   PLUGIN_AUTH_VERSION: 1.0\n...\n`\n\nIf a plugin''s PLUGIN_LIBRARY column has the NULL value, the plugin is built-in and cannot be uninstalled.\n\nQuerying Plugin Information with mysql.plugin\n\nThe mysql.plugin table can be queried to get information about installed plugins.\n\nThis table only contains information about plugins that have been installed via the following methods:\n\n The INSTALL SONAME statement.\n The INSTALL PLUGIN statement.\n The mariadb-plugin utility.\n\nThis table does not contain information about:\n\n Built-in plugins.\n Plugins loaded with the --plugin-load-add option.\n Plugins loaded with the --plugin-load option.\n\nThis table only contains enough information to reload the plugin when the server is restarted, which means it only contains the plugin name and the plugin library.\n\nFor example:\n\n`sql\nSELECT  FROM mysql.plugin;\n\n+------+------------+\n| name | dl         |\n+------+------------+\n| PBXT | libpbxt.so |\n+------+------------+\n`\n\nInstalling a Plugin\n\nThere are three primary ways to install a plugin:\n\n A plugin can be installed dynamically with an SQL statement.\n A plugin can be installed with a mariadbd option, but it requires a server restart.\n A plugin can be installed with the mariadb-plugin utility, while the server is completely offline.\n\nWhen you are installing a plugin, you also have to ensure that:\n\n The server''s plugin directory is properly configured, and the plugin''s library is in the plugin directory.\n The server''s minimum plugin maturity is properly configured, and the plugin is mature enough to be installed.\n\nInstalling a Plugin Dynamically\n\nA plugin can be installed dynamically by executing either the INSTALL SONAME or the INSTALL PLUGIN statement.\n\nIf a plugin is installed with one of these statements, a record will be added to the mysql.plugins table for the plugin. This means that the plugin will automatically be loaded every time the server restarts, unless specifically uninstalled or deactivated.\n\nInstalling a Plugin with INSTALL SONAME\n\nYou can install a plugin dynamically by executing the INSTALL SONAME statement. INSTALL SONAME installs all plugins from the given plugin library. This could be required for some plugin libraries.\n\nFor example, to install all plugins in the server_audit plugin library (which is currently only the server_audit audit plugin), you could execute the following:\n\n`sql\nINSTALL SONAME ''server_audit'';\n`\n\nInstalling a Plugin with INSTALL PLUGIN\n\nYou can install a plugin dynamically by executing the INSTALL PLUGIN statement. INSTALL PLUGIN installs a single plugin from the given plugin library.\n\nFor example, to install the server_audit audit plugin from the server_audit plugin library, you could execute the following:\n\n`sql\nINSTALL PLUGIN server_audit SONAME ''server_audit'';\n`\n\nInstalling a Plugin with Plugin Load Options\n\nA plugin can be installed with a mariadbd option by providing either the --plugin-load-add or the --plugin-load option.\n\nIf a plugin is installed with one of these options, then a record will not be added to the mysql.plugins table for the plugin. This means that if the server is restarted without the same option set, then the plugin will not automatically be loaded.\n\nInstalling a Plugin with --plugin-load-add\n\nYou can install a plugin with the --plugin-load-add option by specifying the option as a command-line argument to mariadbd or by specifying the option in a relevant server option group in an option file.\n\nThe --plugin-load-add option uses the following format:\n\n Plugins can be specified in the format name=library, where name is the plugin name and library is the plugin library. This format installs a single plugin from the given plugin library.\n Plugins can also be specified in the format library, where library is the plugin library. This format installs all plugins from the given plugin library.\n Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which is currently only the server_audit audit plugin) and also the ed25519 authentication plugin from the auth_ed25519 plugin library, you could set the option to the following values on the command-line:\n\n`bash\n$ mariadbd --user=mysql --plugin-load-add=''server_audit'' --plugin-load-add=''ed25519=auth_ed25519''\n`\n\nYou could also set the option to the same values in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load_add = ed25519=auth_ed25519\n`\n\nSpecial care must be taken when specifying both the --plugin-load option and the --plugin-load-add option together. The --plugin-load option resets the plugin load list, and this can cause unexpected problems if you are not aware. The --plugin-load-add option does not reset the plugin load list, so it is much safer to use. See Specifying Multiple Plugin Load Options for more information.\n\nInstalling a Plugin with --plugin-load\n\nYou can install a plugin with the --plugin-load option by specifying the option as a command-line argument to mariadbd or by specifying the option in a relevant server option group in an option file.\n\nThe --plugin-load option uses the following format:\n\n Plugins can be specified in the format name=library, where name is the plugin name and library is the plugin library. This format installs a single plugin from the given plugin library.\n Plugins can also be specified in the format library, where library is the plugin library. This format installs all plugins from the given plugin library.\n Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which is currently only the server_audit audit plugin) and also the ed25519 authentication plugin from the auth_ed25519 plugin library, you could set the option to the following values on the command-line:\n\n`bash\n$ mariadbd --user=mysql --plugin-load=''server_audit;ed25519=auth_ed25519''\n`\n\nYou could also set the option to the same values in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load = server_audit;ed25519=auth_ed25519\n`\n\nSpecial care must be taken when specifying the --plugin-load option multiple times, or when specifying both the --plugin-load option and the --plugin-load-add option together. The --plugin-load option resets the plugin load list, and this can cause unexpected problems if you are not aware. The --plugin-load-add option does not reset the plugin load list, so it is much safer to use. See Specifying Multiple Plugin Load Options for more information.\n\nSpecifying Multiple Plugin Load Options\n\nSpecial care must be taken when specifying the --plugin-load option multiple times, or when specifying both the --plugin-load option and the --plugin-load-add option. The --plugin-load option resets the plugin load list, and this can cause unexpected problems if you are not aware. The --plugin-load-add option does not reset the plugin load list, so it is much safer to use.\n\nThis can have the following consequences:\n\n If the --plugin-load option is specified multiple times, then only the last instance will have any effect. For example, in the following case, the first instance of the option is reset:\n\n`ini\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load = ed25519=auth_ed25519\n`\n\n If the --plugin-load option is specified after the --plugin-load-add option, then it will also reset the changes made by that option. For example, in the following case, the --plugin-load-add option does not do anything, because the subsequent --plugin-load option resets the plugin load list:\n\n`ini\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load = ed25519=auth_ed25519\n`\n\n In contrast, if the --plugin-load option is specified before the --plugin-load-add option, then it will work fine, because the --plugin-load-add option does not reset the plugin load list. For example, in the following case, both plugins are properly loaded:\n\n`ini\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load_add = ed25519=auth_ed25519\n`\n\nInstalling a Plugin with mariadb-plugin\n\nA plugin can be installed with the mariadb-plugin utility if the server is completely offline.\n\nThe syntax is:\n\n`sql\nmariadb-plugin [options] <plugin> ENABLE|DISABLE\n`\n\nFor example, to install the server_audit audit plugin, you could execute the following:\n\n`sql\nmariadb-plugin server_audit ENABLE\n`\n\nIf a plugin is installed with this utility, a record will be added to the mysql.plugins table for the plugin. This means that the plugin will automatically be loaded every time the server restarts, unless specifically uninstalled or deactivated.\n\nConfiguring the Plugin Directory\n\nWhen a plugin is being installed, the server looks for the plugin''s library in the server''s plugin directory. This directory is configured by the plugin_dir system variable. This can be specified as a command-line argument to mariadbd or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_dir = /usr/lib64/mysql/plugin\n`\n\nConfiguring the Minimum Plugin Maturity\n\nWhen a plugin is being installed, the server compares the plugin''s maturity level against the server''s minimum allowed plugin maturity. This can help prevent users from using unstable plugins on production servers. This minimum plugin maturity is configured by the plugin_maturity system variable. This can be specified as a command-line argument to mariadbd or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_maturity = stable\n`\n\nConfiguring Plugin Activation at Server Startup\n\nA plugin will be loaded by default when the server starts if:\n\n The plugin was installed with the INSTALL SONAME statement.\n The plugin was installed with the INSTALL PLUGIN statement.\n The plugin was installed with the mariadb-plugin utility.\n The server is configured to load the plugin with the --plugin-load-add option.\n The server is configured to load the plugin with the --plugin-load option.\n\nThis behavior can be changed with special options that take the form --plugin-name. For example, for the server_audit audit plugin, the special option is called --server-audit.\n\nThe possible values for these special options are:\n\n| Option Value           | Description                                                                                                                                                                                                                                                                                                                                                                                                               |\n| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| OFF                    | Disables the plugin without removing it from the mysql.plugins table.                                                                                                                                                                                                                                                                                 |\n| ON                     | Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled.\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/plugins/plugin-overview');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (142, 16, 'Aggregate Functions', 'Description\n-----------\n\nstored-aggregate-functions.md\n\nStored Aggregate Functions allow users to create custom aggregate functions that process a sequence of rows and return a single summary result. This page provides a general overview.\n\navg.md\n\nCalculate the average value. This function computes the arithmetic mean of a numeric expression, ignoring NULL values.\n\nbit_and.md\n\nPerform a bitwise AND operation. This function returns the result of performing a bitwise AND on all values in a given expression.\n\nbit_or.md\n\nPerform a bitwise OR operation. This function returns the result of performing a bitwise OR on all values in a given expression.\n\nbit_xor.md\n\nPerform a bitwise XOR operation. This function returns the result of performing a bitwise XOR on all values in a given expression.\n\ncount-distinct.md\n\nCount unique values. This function returns the number of distinct, non-NULL values found in the specified column or expression.\n\ncount.md\n\nComplete COUNT() function reference: COUNT(*) and COUNT(expr) syntax, COUNT(DISTINCT) usage, GROUP BY aggregation, and OVER(PARTITION BY) window syntax.\n\ngroup_concat.md\n\nComplete GROUP_CONCAT reference for MariaDB. Complete function guide with syntax, parameters, return values, and usage examples for production use.\n\njson_arrayagg.md\n\nAggregate values into a JSON array. This function aggregates a result set column into a single JSON array.\n\njson_objectagg.md\n\nAggregate key-value pairs into a JSON object. This function aggregates two columns or expressions into a single JSON object.\n\nmax.md\n\nFind the maximum value. This function returns the highest value in a set of values, applicable to numbers, strings, and dates.\n\nmin.md\n\nFind the minimum value. This function returns the lowest value in a set of values, applicable to numbers, strings, and dates.\n\nstd.md\n\nCalculate population standard deviation. This function returns the square root of the population variance. It is a synonym for STDDEV_POP().\n\nstddev.md\n\nCalculate population standard deviation. This function is a synonym for STD() and STDDEV_POP(), returning the square root of the population variance.\n\nstddev_pop.md\n\nCalculate population standard deviation. This function computes the standard deviation assuming the set of values represents the entire population.\n\nstddev_samp.md\n\nCalculate sample standard deviation. This function computes the standard deviation assuming the set of values represents a sample of the population.\n\nsum.md\n\nCalculate the total sum. This function returns the sum of all values in a numeric expression, ignoring NULL values.\n\nvar_pop.md\n\nCalculate population variance. This function computes the statistical variance for a set of values assumed to be the entire population.\n\nvar_samp.md\n\nCalculate sample variance. This function computes the statistical variance for a set of values assumed to be a sample of the population.\n\nvariance.md\n\nCalculate population variance. This function is a synonym for VAR_POP() and returns the variance of a set of values.\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/README', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/README');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (143, 16, 'AVG', 'Syntax\n------\n\nAVG([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the average value of expr. The DISTINCT option can be used to return the average of the distinct values of expr. NULL values are ignored. It is an aggregate function, and so can be used with the GROUP BY clause.\n\nAVG() returns NULL if there were no matching rows.\n\nAVG() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\n\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT AVG(sales_value) FROM sales;\n+------------------+\n| AVG(sales_value) |\n+------------------+\n|          22.5000 |\n+------------------+\n\nSELECT AVG(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| AVG(DISTINCT(sales_value)) |\n+----------------------------+\n|                    23.3333 |\n+----------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/avg', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/avg');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (144, 16, 'BIT\\_AND', 'Syntax\n------\n\nBIT_AND(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise AND of all bits in _expr_. The calculation is performed with 64-bit (BIGINT) precision. It is an aggregate function, and so can be used with the GROUP BY clause.\n\nIf no rows match, BIT_AND will return a value with all bits set to 1. NULL values have no effect on the result unless all results are NULL, which is treated as no match.\n\nBIT_AND can be used as a window function with the addition of the _over_clause_.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/bit_and', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/bit_and');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (145, 16, 'BIT\\_OR', 'Syntax\n------\n\nBIT_OR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise OR of all bits in expr. The calculation is performed with 64-bit (BIGINT) precision. It is an aggregate function, and so can be used with the GROUP BY clause.\n\nIf no rows match, BIT_OR will return a value with all bits set to 0. NULL values have no effect on the result unless all results are NULL, which is treated as no match.\n\nBIT_OR can be used as a window function with the addition of the _over_clause_.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/bit_or', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/bit_or');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (146, 16, 'BIT\\_XOR', 'Syntax\n------\n\nBIT_XOR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise XOR of all bits in expr. The calculation is performed with 64-bit (BIGINT) precision. It is an aggregate function, and so can be used with the GROUP BY clause.\n\nIf no rows match, BIT_XOR will return a value with all bits set to 0. NULL values have no effect on the result unless all results are NULL, which is treated as no match.\n\nBIT_XOR can be used as a window function with the addition of the _over_clause_.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/bit_xor', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/bit_xor');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (147, 16, 'COUNT DISTINCT', 'Syntax\n------\n\nCOUNT(DISTINCT expr,[expr...])\n\nDescription\n-----------\n\nReturns a count of the number of different non-NULL values.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); \n\nINSERT INTO student VALUES \n  (''Chun'', ''SQL'', 75), (''Chun'', ''Tuning'', 73), \n  (''Esben'', ''SQL'', 43), (''Esben'', ''Tuning'', 31), \n  (''Kaolin'', ''SQL'', 56), (''Kaolin'', ''Tuning'', 88), \n  (''Tatiana'', ''SQL'', 87), (''Tatiana'', ''Tuning'', 83);\n\nSELECT COUNT() FROM student;\n+----------+\n| COUNT() |\n+----------+\n|        8 |\n+----------+\n\nSELECT COUNT(DISTINCT (name)) FROM student;\n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n|                      4 |\n+------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/count-distinct', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/count-distinct');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (148, 16, 'COUNT', 'Description\n-----------\n\nReturns a count of the number of non-NULL values of expr in the rows retrieved by a SELECT statement. The result is a BIGINT value. It is an aggregate function, and so can be used with the GROUP BY clause.\n\nCOUNT(\\) counts the total number of rows in a table.\n\nCOUNT() returns 0 if there were no matching rows.\n\nCOUNT() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); \n\nINSERT INTO student VALUES \n  (''Chun'', ''SQL'', 75), (''Chun'', ''Tuning'', 73), \n  (''Esben'', ''SQL'', 43), (''Esben'', ''Tuning'', 31), \n  (''Kaolin'', ''SQL'', 56), (''Kaolin'', ''Tuning'', 88), \n  (''Tatiana'', ''SQL'', 87), (''Tatiana'', ''Tuning'', 83);\n\nSELECT COUNT() FROM student;\n+----------+\n| COUNT(*) |\n+----------+\n|        8 |\n+----------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/count', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/count');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (149, 16, 'GROUP\\_CONCAT', 'Syntax\n------\n\nGROUP_CONCAT(expr)\n\nDescription\n-----------\n\nThis function returns a string result with the concatenated non-NULL values from a group. If any expr in GROUP_CONCAT evaluates to NULL, that tuple is not present in the list returned by GROUP_CONCAT.\n\nIt returns NULL if all arguments are NULL, or there are no matching rows.\n\nThe maximum returned length in bytes is determined by the group_concat_max_len server system variable, which defaults to 1M.\n\nIf group_concat_max_len <= 512, the return type is VARBINARY or VARCHAR; otherwise, the return type is BLOB or TEXT. The choice between binary or non-binary types depends from the input.\n\nThe full syntax is as follows:\n\n``sql\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n             [ORDER BY {unsigned_integer | col_name | expr}\n                 [ASC | DESC] [,col_name ...]]\n             [SEPARATOR str_val]\n             [LIMIT {[offset,] row_count | row_count OFFSET offset}])\n`\n\nDISTINCT eliminates duplicate values from the output string.\n\nORDER BY determines the order of returned values.\n\nSEPARATOR specifies a separator between the values. The default separator is a comma (,). It is possible to avoid using a separator by specifying an empty string.\n\nLIMIT\n\nThe LIMIT clause can be used with GROUP_CONCAT`.\n\nExamples\n--------\n\nSELECT student_name,\n       GROUP_CONCAT(test_score)\n       FROM student\n       GROUP BY student_name;\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/group_concat', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/group_concat');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (150, 16, 'MAX', 'Syntax\n------\n\nMAX([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the largest, or maximum, value of _expr_. MAX() can also take a string argument in which case it returns the maximum string value. The DISTINCT keyword can be used to find the maximum of the distinct values of _expr_, however, this produces the same result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value rather than their relative position in the set, so MAX() may produce a different highest result than ORDER BY DESC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nMAX() can be used as a window function.\n\nMAX() returns NULL if there were no matching rows.\n\nNot only ascending, but also descending indexes can be used to optimize MAX.\n\nOnly ascending indexes can be used to optimize MAX.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); \n\nINSERT INTO student VALUES \n  (''Chun'', ''SQL'', 75), (''Chun'', ''Tuning'', 73), \n  (''Esben'', ''SQL'', 43), (''Esben'', ''Tuning'', 31), \n  (''Kaolin'', ''SQL'', 56), (''Kaolin'', ''Tuning'', 88), \n  (''Tatiana'', ''SQL'', 87), (''Tatiana'', ''Tuning'', 83);\n\nSELECT name, MAX(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | MAX(score) |\n+---------+------------+\n| Chun    |         75 |\n| Esben   |         43 |\n| Kaolin  |         88 |\n| Tatiana |         87 |\n+---------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/max', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/max');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (151, 16, 'MIN', 'Syntax\n------\n\nMIN([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the minimum value of _expr_. MIN() may take a string argument, in which case it returns the minimum string value. The DISTINCT keyword can be used to find the minimum of the distinct values of _expr_, however, this produces the same result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value rather than their relative position in the set, so MIN() may produce a different lowest result than ORDER BY ASC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nMIN() can be used as a window function.\n\nMIN() returns NULL if there were no matching rows.\n\nNot only ascending, but also descending indexes can be used to optimize MIN.\n\nOnly ascending indexes can be used to optimize MIN.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); \n\nINSERT INTO student VALUES \n  (''Chun'', ''SQL'', 75), (''Chun'', ''Tuning'', 73), \n  (''Esben'', ''SQL'', 43), (''Esben'', ''Tuning'', 31), \n  (''Kaolin'', ''SQL'', 56), (''Kaolin'', ''Tuning'', 88), \n  (''Tatiana'', ''SQL'', 87), (''Tatiana'', ''Tuning'', 83);\n\nSELECT name, MIN(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | MIN(score) |\n+---------+------------+\n| Chun    |         73 |\n| Esben   |         31 |\n| Kaolin  |         56 |\n| Tatiana |         83 |\n+---------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/min', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/min');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (152, 16, 'STD', 'Syntax\n------\n\nSTD(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of _expr_. This is an extension to standard SQL. The standard SQL function STDDEV_POP() can be used instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTD() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n  (''a'',1),(''a'',2),(''a'',3),\n  (''b'',11),(''b'',12),(''b'',20),(''b'',30),(''b'',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n  FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/std', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/std');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (153, 16, 'STDDEV', 'Syntax\n------\n\nSTDDEV(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of _expr_. This function is provided for compatibility with Oracle. The standard SQL function STDDEV_POP() can be used instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n  (''a'',1),(''a'',2),(''a'',3),\n  (''b'',11),(''b'',12),(''b'',20),(''b'',30),(''b'',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n  FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/stddev', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/stddev');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (154, 16, 'STDDEV\\_POP', 'Syntax\n------\n\nSTDDEV_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of _expr_ (the square root of VAR_POP()). You can also use STD() or STDDEV(), which are equivalent but not standard SQL.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV_POP() can be used as a window function.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n  (''a'',1),(''a'',2),(''a'',3),\n  (''b'',11),(''b'',12),(''b'',20),(''b'',30),(''b'',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n  FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/stddev_pop', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/stddev_pop');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (155, 16, 'STDDEV\\_SAMP', 'Syntax\n------\n\nSTDDEV_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample standard deviation of expr (the square root of VAR_SAMP()).\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV_SAMP() can be used as a window function.\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/stddev_samp', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/stddev_samp');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (156, 16, 'SUM', 'Syntax\n------\n\nSUM([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the sum of _expr_. If the return set has no rows, SUM() returnsNULL. The DISTINCT keyword can be used to sum only the distinct values of expr.\n\nSUM() can be used as a window function, although not with the DISTINCT specifier.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT SUM(sales_value) FROM sales;\n+------------------+\n| SUM(sales_value) |\n+------------------+\n|               90 |\n+------------------+\n\nSELECT SUM(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| SUM(DISTINCT(sales_value)) |\n+----------------------------+\n|                         70 |\n+----------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/sum', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/sum');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (157, 16, 'VAR\\_POP', 'Syntax\n------\n\nVAR_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. It considers rows as the whole population, not as a sample, so it has the number of rows as the denominator. You can also use VARIANCE(), which is equivalent but is not standard SQL.\n\nVariance is calculated by\n\n working out the mean for the set;\n for each number, subtracting the mean and squaring the result;\n* calculating the average of the resulting differences.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVAR_POP() can be used as a window function.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n|     1.0000 |\n+------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n|   200.5000 |\n+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/var_pop', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/var_pop');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (158, 16, 'VAR\\_SAMP', 'Syntax\n------\n\nVAR_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample variance of _expr_. That is, the denominator is the number of rows minus one.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVAR_SAMP() can be used as a window function.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n  (''a'',1),(''a'',2),(''a'',3),\n  (''b'',11),(''b'',12),(''b'',20),(''b'',30),(''b'',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n  FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/var_samp', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/var_samp');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (159, 16, 'VARIANCE', 'Syntax\n------\n\nVARIANCE(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. This is an extension to standard SQL. The standard SQL function VAR_POP() can be used instead.\n\nVariance is calculated by\n\n working out the mean for the set;\n for each number, subtracting the mean and squaring the result;\n* calculating the average of the resulting differences.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVARIANCE() can be used as a window function.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n|      1.0000 |\n+-------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n|    200.5000 |\n+-------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/variance', '', 'https://mariadb.com/docs/server/reference/sql-functions/aggregate-functions/variance');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (160, 7, 'CASE OPERATOR', 'Syntax\n------\n\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nDescription\n-----------\n\nThe first version returns the result for the first value=compare_value comparison that is true. The second version returns the result for the first condition that is true. If there was no matching result value, the result after ELSE is returned, or NULL if there is no ELSE part.\n\nThere is also a CASE statement, which differs from the CASE operator described here.\n\nExamples\n--------\n\nSELECT CASE 1 WHEN 1 THEN ''one'' WHEN 2 THEN ''two'' ELSE ''more'' END;\n+------------------------------------------------------------+\n| CASE 1 WHEN 1 THEN ''one'' WHEN 2 THEN ''two'' ELSE ''more'' END |\n+------------------------------------------------------------+\n| one                                                        |\n+------------------------------------------------------------+\n\nSELECT CASE WHEN 1>0 THEN ''true'' ELSE ''false'' END;\n+--------------------------------------------+\n| CASE WHEN 1>0 THEN ''true'' ELSE ''false'' END |\n+--------------------------------------------+\n| true                                       |\n+--------------------------------------------+\n\nSELECT CASE BINARY ''B'' WHEN ''a'' THEN 1 WHEN ''b'' THEN 2 END;\n+-----------------------------------------------------+\n| CASE BINARY ''B'' WHEN ''a'' THEN 1 WHEN ''b'' THEN 2 END |\n+-----------------------------------------------------+\n|                                                NULL |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/case-operator', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/case-operator');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (161, 7, 'DECODE\\_ORACLE', 'Description\n-----------\n\nDECODE_ORACLE is a synonym for the Oracle mode version of the DECODE function, and is available in all modes.\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/decode_oracle', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/decode_oracle');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (162, 7, 'IF Function', 'Syntax\n------\n\nIF(expr1,expr2,expr3)\n\nDescription\n-----------\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2; otherwise it returns expr3. IF() returns a numeric or string value, depending on the context in which it is used.\n\nNote: There is also an IF statement which differs from theIF() function described here.\n\nExamples\n--------\n\nSELECT IF(1>2,2,3);\n+-------------+\n| IF(1>2,2,3) |\n+-------------+\n|           3 |\n+-------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/if-function', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/if-function');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (163, 7, 'IFNULL', 'Syntax\n------\n\nIFNULL(expr1,expr2)\nNVL(expr1,expr2)\n\nDescription\n-----------\n\nIf _expr1_ is not NULL, IFNULL() returns _expr1_; otherwise it returns_expr2_. IFNULL() returns a numeric or string value, depending on the context in which it is used.\n\nNVL() is an alias for IFNULL().\n\nExamples\n--------\n\nSELECT IFNULL(1,0); \n+-------------+\n| IFNULL(1,0) |\n+-------------+\n|           1 |\n+-------------+\n\nSELECT IFNULL(NULL,10);\n+-----------------+\n| IFNULL(NULL,10) |\n+-----------------+\n|              10 |\n+-----------------+\n\nSELECT IFNULL(1/0,10);\n+----------------+\n| IFNULL(1/0,10) |\n+----------------+\n|        10.0000 |\n+----------------+\n\nSELECT IFNULL(1/0,''yes'');\n+-------------------+\n| IFNULL(1/0,''yes'') |\n+-------------------+\n| yes               |\n+-------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/ifnull', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/ifnull');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (164, 7, 'NULLIF', 'Syntax\n------\n\nNULLIF(expr1,expr2)\n\nDescription\n-----------\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nExamples\n--------\n\nSELECT NULLIF(1,1);\n+-------------+\n| NULLIF(1,1) |\n+-------------+\n|        NULL |\n+-------------+\n\nSELECT NULLIF(1,2);\n+-------------+\n| NULLIF(1,2) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nullif', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nullif');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (165, 7, 'NVL', 'Description\n-----------\n\nNVL is a synonym for IFNULL.\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nvl', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nvl');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (166, 7, 'NVL2', 'Syntax\n------\n\nNVL2(expr1,expr2,expr3)\n\nDescription\n-----------\n\nThe NVL2 function returns a value based on whether a specified expression is NULL or not. If _expr1_ is not NULL, then NVL2 returns _expr2_. If _expr1_ is NULL, then NVL2 returns _expr3_.\n\nExamples\n--------\n\nSELECT NVL2(NULL,1,2);\n+----------------+\n| NVL2(NULL,1,2) |\n+----------------+\n|              2 |\n+----------------+\n\nSELECT NVL2(''x'',1,2);\n+---------------+\n| NVL2(''x'',1,2) |\n+---------------+\n|             1 |\n+---------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nvl2', '', 'https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nvl2');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (167, 31, 'ADD\\_MONTHS', 'Syntax\n------\n\nADD_MONTHS(date, months)\n\nDescription\n-----------\n\nADD_MONTHS adds an integer _months_ to a given _date_ (DATE, DATETIME or TIMESTAMP), returning the resulting date.\n\n_months_ can be positive or negative. If months is not a whole number, it is rounded to the nearest whole number (not truncated).\n\nThe resulting day component will remain the same as that specified in _date_, unless the resulting month has fewer days than the day component of the given date, in which case the day will be the last day of the resulting month.\n\nReturns NULL if given an invalid date or a NULL argument.\n\nExamples\n--------\n\nSELECT ADD_MONTHS(''2012-01-31'', 2);\n+-----------------------------+\n| ADD_MONTHS(''2012-01-31'', 2) |\n+-----------------------------+\n| 2012-03-31                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(''2012-01-31'', -5);\n+------------------------------+\n| ADD_MONTHS(''2012-01-31'', -5) |\n+------------------------------+\n| 2011-08-31                   |\n+------------------------------+\n\nSELECT ADD_MONTHS(''2011-01-31'', 1);\n+-----------------------------+\n| ADD_MONTHS(''2011-01-31'', 1) |\n+-----------------------------+\n| 2011-02-28                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(''2012-01-31'', 1);\n+-----------------------------+\n| ADD_MONTHS(''2012-01-31'', 1) |\n+-----------------------------+\n| 2012-02-29                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(''2012-01-31'', 2);\n+-----------------------------+\n| ADD_MONTHS(''2012-01-31'', 2) |\n+-----------------------------+\n| 2012-03-31                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(''2012-01-31'', 3);\n+-----------------------------+\n| ADD_MONTHS(''2012-01-31'', 3) |\n+-----------------------------+\n| 2012-04-30                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(''2011-01-15'', 2.5);\n+-------------------------------+\n| ADD_MONTHS(''2011-01-15'', 2.5) |\n+-------------------------------+\n| 2011-04-15                    |\n+-------------------------------+\n1 row in set (0.001 sec)\n\nSELECT ADD_MONTHS(''2011-01-15'', 2.6);\n+-------------------------------+\n| ADD_MONTHS(''2011-01-15'', 2.6) |\n+-------------------------------+\n| 2011-04-15                    |\n+-------------------------------+\n1 row in set (0.001 sec)\n\nSELECT ADD_MONTHS(''2011-01-15'', 2.1);\n+-------------------------------+\n| ADD_MONTHS(''2011-01-15'', 2.1) |\n+-------------------------------+\n| 2011-03-15                    |\n+-------------------------------+\n1 row in set (0.004 sec)\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/add_months', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/add_months');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (168, 31, 'ADDDATE', 'Syntax\n------\n\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE() is a synonym for DATE_ADD(). The related function SUBDATE() is a synonym for DATE_SUB(). For information on the INTERVAL unit argument, see the discussion for DATE_ADD().\n\nWhen invoked with the days form of the second argument, MariaDB treats it as an integer number of days to be added to _expr_.\n\nExamples\n--------\n\nSELECT DATE_ADD(''2008-01-02'', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_ADD(''2008-01-02'', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2008-02-02                              |\n+-----------------------------------------+\n\nSELECT ADDDATE(''2008-01-02'', INTERVAL 31 DAY);\n+----------------------------------------+\n| ADDDATE(''2008-01-02'', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2008-02-02                             |\n+----------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/adddate', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/adddate');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (169, 31, 'ADDTIME', 'Syntax\n------\n\nADDTIME(expr1,expr2)\n\nDescription\n-----------\n\nADDTIME() adds _expr2_ to _expr1_ and returns the result. _expr1_ is a time or datetime expression, and _expr2_ is a time expression.\n\nExamples\n--------\n\nSELECT ADDTIME(''2007-12-31 23:59:59.999999'', ''1 1:1:1.000002'');\n+---------------------------------------------------------+\n| ADDTIME(''2007-12-31 23:59:59.999999'', ''1 1:1:1.000002'') |\n+---------------------------------------------------------+\n| 2008-01-02 01:01:01.000001                              |\n+---------------------------------------------------------+\n\nSELECT ADDTIME(''01:00:00.999999'', ''02:00:00.999998'');\n+-----------------------------------------------+\n| ADDTIME(''01:00:00.999999'', ''02:00:00.999998'') |\n+-----------------------------------------------+\n| 03:00:01.999997                               |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/addtime', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/addtime');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (170, 31, 'CONVERT\\_TZ', 'Syntax\n------\n\nCONVERT_TZ(dt,from_tz,to_tz)\n\nDescription\n-----------\n\nCONVERT_TZ() converts a datetime value _dt_ from the time zone given by _from_tz_ to the time zone given by _to_tz_ and returns the resulting value.\n\nIn order to use named time zones, such as GMT, MET or Africa/Johannesburg, the time_zone tables must be loaded (see mysql_tzinfo_to_sql).\n\nNo conversion takes place if the value falls outside of the supported TIMESTAMP range when converted from _from_tz_ to UTC.\n\nThe supported range is 1970-01-01 00:00:00 to 2106-02-07 06:28:15 UTC.\n\nThe supported range is 1970-01-01 00:00:01 to 2038-01-19 05:14:07 UTC.\n\nThis function returns NULL if the arguments are invalid (or named time zones have not been loaded).\n\nSee time zones for more information.\n\nExamples\n--------\n\nSELECT CONVERT_TZ(''2016-01-01 12:00:00'',''+00:00'',''+10:00'');\n+-----------------------------------------------------+\n| CONVERT_TZ(''2016-01-01 12:00:00'',''+00:00'',''+10:00'') |\n+-----------------------------------------------------+\n| 2016-01-01 22:00:00                                 |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/convert_tz', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/convert_tz');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (171, 31, 'CURDATE', 'Syntax\n------\n\nCURDATE()\nCURRENT_DATE\nCURRENT_DATE()\n\nDescription\n-----------\n\nCURDATE returns the current date as a value in YYYY-MM-DD or YYYYMMDD format, depending on whether the function is used in a string or numeric context.\n\nCURRENT_DATE and CURRENT_DATE() are synonyms.\n\nExamples\n--------\n\nSELECT CURDATE();\n+------------+\n| CURDATE()  |\n+------------+\n| 2019-03-05 |\n+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/curdate', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/curdate');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (172, 31, 'CURRENT\\_DATE', 'Syntax\n------\n\nCURRENT_DATE, CURRENT_DATE()\n\nDescription\n-----------\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/current_date', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/current_date');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (173, 31, 'CURRENT\\_TIME', 'Syntax\n------\n\nCURRENT_TIME\nCURRENT_TIME([precision])\n\nDescription\n-----------\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/current_time', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/current_time');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (174, 31, 'CURRENT\\_TIMESTAMP', 'Syntax\n------\n\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\n\nDescription\n-----------\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/current_timestamp', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/current_timestamp');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (175, 31, 'CURTIME', 'Syntax\n------\n\nCURTIME([precision])\n\nDescription\n-----------\n\nReturns the current time as a value in HH:MM:SS or HHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone.\n\nThe optional _precision_ determines the microsecond precision. See Microseconds in MariaDB.\n\nExamples\n--------\n\nSELECT CURTIME();\n+-----------+\n| CURTIME() |\n+-----------+\n| 12:45:39  |\n+-----------+\n\nSELECT CURTIME() + 0;\n+---------------+\n| CURTIME() + 0 |\n+---------------+\n| 124545.000000 |\n+---------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/curtime', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/curtime');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (176, 31, 'Date and Time Units', 'Description\n-----------\n\nThe INTERVAL keyword can be used to add or subtract a time interval of time to a DATETIME, DATE or TIME value.\n\nThe syntax is:\n\n``sql\nINTERVAL time_quantity time_unit\n`\n\nFor example, the SECOND unit is used below by the DATE_ADD() function:\n\n`sql\nSELECT ''2008-12-31 23:59:59'' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| ''2008-12-31 23:59:59'' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00                       |\n+-------------------------------------------+\n`\n\nThe following units are valid:\n\n| Unit                | Description                             |\n| ------------------- | --------------------------------------- |\n| MICROSECOND         | Microseconds                            |\n| SECOND              | Seconds                                 |\n| MINUTE              | Minutes                                 |\n| HOUR                | Hours                                   |\n| DAY                 | Days                                    |\n| WEEK                | Weeks                                   |\n| MONTH               | Months                                  |\n| QUARTER             | Quarters                                |\n| YEAR                | Years                                   |\n| SECOND_MICROSECOND | Seconds.Microseconds                    |\n| MINUTE_MICROSECOND | Minutes.Seconds.Microseconds            |\n| MINUTE_SECOND      | Minutes.Seconds                         |\n| HOUR_MICROSECOND   | Hours.Minutes.Seconds.Microseconds      |\n| HOUR_SECOND        | Hours.Minutes.Seconds                   |\n| HOUR_MINUTE        | Hours.Minutes                           |\n| DAY_MICROSECOND    | Days Hours.Minutes.Seconds.Microseconds |\n| DAY_SECOND         | Days Hours.Minutes.Seconds              |\n| DAY_MINUTE         | Days Hours.Minutes                      |\n| DAY_HOUR           | Days Hours                              |\n| YEAR_MONTH         | Years-Months                            |\n\nThe time units containing an underscore are composite; that is, they consist of multiple base time units. For base time units, time_quantity is an integer number. For composite units, the quantity must be expressed as a string with multiple integer numbers separated by any punctuation character.\n\nExample of composite units:\n\n`sql\nINTERVAL ''2:2'' YEAR_MONTH\nINTERVAL ''1:30:30'' HOUR_SECOND\nINTERVAL ''1!30!30'' HOUR_SECOND -- same as above\n`\n\nTime units can be used in the following contexts:\n\n after a + or a - operator;\n with the following DATE or TIME functions: ADDDATE(), SUBDATE(), DATE_ADD(), DATE_SUB(), TIMESTAMPADD(), TIMESTAMPDIFF(), EXTRACT();\n in the ON SCHEDULE clause of CREATE EVENT and ALTER EVENT;\n when defining a partitioning BY SYSTEM_TIME` .\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date-and-time-units', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date-and-time-units');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (177, 31, 'DATE FUNCTION', 'Syntax\n------\n\nDATE(expr)\n\nDescription\n-----------\n\nExtracts the date part of the date or datetime expression _expr_. Returns NULL and throws a warning when passed an invalid date.\n\nExamples\n--------\n\nSELECT DATE(''2013-07-18 12:21:32'');\n+-----------------------------+\n| DATE(''2013-07-18 12:21:32'') |\n+-----------------------------+\n| 2013-07-18                  |\n+-----------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date-function', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date-function');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (178, 31, 'DATE\\_ADD', 'Syntax\n------\n\nDATE_ADD(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The _date_ argument specifies the starting date or datetime value. _expr_ is an expression specifying the interval value to be added to the starting date. _expr_ is a string; it may start with a "-" for negative intervals. For composite interval units (such as DAY_HOUR, MINUTE_SECOND, and SECOND_MICROSECOND), \n_expr_ can contain multiple components separated by spaces or punctuation. For example:\n\n- ''1 10'' DAY_HOUR represents 1 day and 10 hours  \n- ''1:1'' MINUTE_SECOND represents 1 minute and 1 second  \n- ''1.999999'' SECOND_MICROSECOND represents seconds and microseconds  \n\nThe exact format of _expr_ depends on the _unit_ specified.\n\n_unit_ is a keyword indicating the units in which the expression should be interpreted. See Date and Time Units for a complete list of permitted units.\n\nThe result type of DATE_ADD() is determined as follows:\n\n if the first argument is of the type DATETIME, the function returns DATETIME ;\n if the first argument is DATE and the interval uses HOUR or smaller units, the function returns DATETIME ;\n if the first argument is DATE and the interval uses DAY or larger units, the function returns DATE ;\n similarly, if the first argument is TIME and the interval uses DAY or smaller units the function returns TIME, if the interval uses anything larger, the function returns DATETIME ;\n* if the first argument isn''t a temporal type, the function returns a string.\n\nExamples\n--------\n\nSELECT ''2008-12-31 23:59:59'' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| ''2008-12-31 23:59:59'' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00                       |\n+-------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date_add', '', 'https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date_add');
