INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (509, 26, 'Using Buffer UPDATE Algorithm', 'Description\n-----------\n\nThis article explains the UPDATE statement''s _Using Buffer_ algorithm.\n\nConsider the following table and query:\n\n| Name      | Salary |\n| --------- | ------ |\n| Babatunde | 1000   |\n| Jolana    | 1050   |\n| Pankaja   | 1300   |\n\n``sql\nUPDATE employees SET salary = salary+100 WHERE salary < 2000;\n`\n\nSuppose the _employees_ table has an index on the _salary_ column, and the optimizer decides to use a range scan on that index.\n\nThe optimizer starts a range scan on the _salary_ index. We find the first record _Babatunde, 1000_. If we do an on-the-fly update, we immediately instruct the storage engine to change this record to be _Babatunde, 1000+100=1100_.\n\nThen we proceed to search for the next record, and find _Jolana, 1050_. We instruct the storage engine to update it to be _Jolana, 1050+100=1150_.\n\nThen we proceed to search for the next record ... and what happens next depends on the storage engine. In some storage engines, data changes are visible immediately, so we will find the _Babatunde, 1100_ record that we wrote at the first step, modifying it again, giving Babatunde an undeserved raise. Then we will see Babatunde again and again, looping continually.\n\nIn order to prevent such situations, the optimizer checks whether the UPDATE statement is going to change key values for the keys it is using. In that case, it will use a different algorithm:\n\n1. Scan everyone with "salary<2000", remembering the rowids of the rows in a buffer.\n2. Read the buffer and apply the updates.\n\nThis way, each row will be updated only once.\n\nThe Using buffer` EXPLAIN output indicates that the buffer as described above will be used.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/using-buffer-update-algorithm', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/using-buffer-update-algorithm');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (510, 26, 'BACKUP LOCK', 'Description\n-----------\n\nBACKUP LOCK blocks a table from DDL statements. This is mainly intended to be used by tools like mariadb-backup that need to ensure there are no DDL[^1] statements on a table while the table files are opened. For example, for an Aria table that stores data in 3 files with extensions .frm, .MAI and .MAD. Normal read/write operations can continue as normal.\n\nSyntax\n\nTo lock a table:\n\n``sql\nBACKUP LOCK table_name\n`\n\nTo unlock a table:\n\n`sql\nBACKUP UNLOCK\n`\n\nUsage in a Backup Tool\n\n`sql\nBACKUP LOCK [database.]table_name;\n - Open all files related to a table (for example, t.frm, t.MAI and t.MYD)\nBACKUP UNLOCK;\n- Copy data\n- Close files\n`\n\nThis ensures that all files are from the same generation, that is created at the same time by the MariaDB server. This works, because the open files will point to the original table files which will not be affected if there is any ALTER TABLE while copying the files.\n\nPrivileges\n\nBACKUP LOCK requires the database LOCK TABLES privileges.\n\nBACKUP LOCK requires the RELOAD privilege.\n\nBACKUP LOCK requires the RELOAD privilege.\n\nNotes\n\n The idea is that the BACKUP LOCK should be held for as short a time as possible by the backup tool. The time to take an uncontested lock is very short! One can easily do 50,000 locks/unlocks per second on low end hardware.\n One should use different connections for BACKUP STAGE commands and BACKUP LOCK.\n\nImplementation\n\n* Internally, BACKUP LOCK is implemented by taking an MDLSHARED_HIGH_PRIO` MDL lock on the table object, which protects the table from any DDL operations.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/backup-commands/backup-lock', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/backup-commands/backup-lock');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (511, 26, 'BACKUP STAGE', 'Description\n-----------\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an efficient external backup tool.\n\nSyntax\n\n``sql\nBACKUP STAGE [START | FLUSH | BLOCK_DDL | BLOCK_COMMIT | END ]\n`\n\nIn the following text, a transactional table means InnoDB, or specifically an InnoDB-like engine with redo log that can lock redo purges and can be copied without locks by an outside process.\n\nGoals with BACKUP STAGE Commands\n\n To be able to do a majority of the backup with the minimum possible server locks. Especially for transactional tables (InnoDB, MyRocks etc) there is only need for a very short block of new commits while copying statistics and log tables.\n DDL are only needed to be blocked for a very short duration of the backup while mariadb-backup is copying the tables affected by DDL during the initial part of the backup.\n Most non transactional tables (those that are not in use) will be copied during BACKUP STAGE START. The exceptions are system statistic and log tables that are not blocked during the backup until BLOCK_COMMIT.\n Should work efficiently with backup tools that use disk snapshots.\n Should work as efficiently as possible for all table types that store data on the local disks.\n As little copying as possible under higher level stages/locks. For example, .frm (dictionary) and .trn (trigger) files should be copying while copying the table data.\n\nBACKUP STAGE Commands\n\nBACKUP STAGE START\n\nThe START stage is designed for the following tasks:\n\n Blocks purge of redo files for storage engines that needs this (Aria).\n Start logging of DDL commands into _datadir_/ddl.log. This may take a short time as the command has to wait until there are no active DDL commands.\n\nBACKUP STAGE FLUSH\n\nThe FLUSH stage is designed for the following tasks:\n\n FLUSH all changes for inactive non-transactional tables, except for statistics and log tables.\n Close all tables that are not in use, to ensure they are marked as closed for the backup.\n BLOCK all new write locks for all non transactional tables (except statistics and log tables). The command will not wait for tables that are in use by read-only transactions.\n\nDDLs don''t have to be blocked at this stage as they can''t cause the table to be in an inconsistent state. This is true also for non-transactional tables.\n\nBACKUP STAGE BLOCK_DDL\n\nThe BLOCK_DDL stage is designed for the following tasks:\n\n Wait for all statements using write locked non-transactional tables to end.\n Blocks CREATE TABLE, DROP TABLE, TRUNCATE TABLE, and RENAME TABLE.\n Blocks also start off a new ALTER TABLE and the final rename phase of ALTER TABLE. Running ALTER TABLES are not blocked.\n\nBACKUP STAGE BLOCK_COMMIT\n\nThe BLOCK_COMMIT stage is designed for the following tasks:\n\n Lock the binary log and commit/rollback to ensure that no changes are committed to any tables. If there are active commits or data to be copied to the binary log this will be allowed to finish. Active transactions will not affect BLOCK_COMMIT.\n This doesn''t lock temporary tables that are not used by replication. However these will be blocked when it''s time to write to the binary log.\n Lock system log tables and statistics tables, flush them and mark them closed.\n\nWhen the BLOCK_COMMIT''s stages return, this is the ''backup time''. Everything committed will be in the backup and everything not committed will roll back.\n\nTransactional engines will continue to do changes to the redo log during the BLOCK COMMIT stage, but this is not important as all of these will roll back later as the changes will not be committed.\n\nBACKUP STAGE END\n\nThe END stage is designed for the following tasks:\n\n End DDL logging\n Free resources\n\nUsing BACKUP STAGE Commands with Backup Tools\n\nUsing BACKUP STAGE Commands with mariadb-backup\n\nThe BACKUP STAGE statements are a set of statements that make it possible to make an efficient external backup tool.\n\nThe BACKUP STAGE statements are a set of statements that make it possible to make an efficient external backup tool. How mariadb-backup uses these statements depends on which version you are using. It depends on whether you are using the version that is bundled with MariaDB Community Server or the version that is bundled with MariaDB Enterprise Server.\n\nThe BACKUP STAGE statements are a set of statements that make it possible to make an efficient external backup tool. How mariadb-backup uses these statements depends on which version you are using. It depends on whether you are using the version that is bundled with MariaDB Community Server or the version that is bundled with MariaDB Enterprise Server.\n\nSee mariadb-backup and BACKUP STAGE Commands for some examples on how mariadb-backup uses these commands.\n\nUsing BACKUP STAGE Commands with Storage Snapshots\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an efficient external backup tool. These commands could even be used by tools that perform backups by taking a snapshot of a file system, SAN, or some other kind of storage device. See Storage Snapshots and BACKUP STAGE Commands for some examples on how to use each BACKUP STAGE command in an efficient way.\n\nPrivileges\n\nBACKUP STAGE requires the RELOAD privilege.\n\nNotes\n\n Only one connection can run BACKUP STAGE START. If a second connection tries, it will wait until the first one has executed BACKUP STAGE END.\n If the user skips a BACKUP STAGE, then all intermediate backup stages will automatically be run. This will allow us to add new stages within the BACKUP STAGE hierarchy in the future with even more precise locks without causing problems for tools using an earlier version of the BACKUP STAGE implementation.\n One can use the max_statement_time or lock_wait_timeout system variables to ensure that a BACKUP STAGE` command doesn''t block the server too long.\n DDL logging is available from MariaDB 10.11.8, MariaDB 11.0.6, MariaDB 11.1.5 and MariaDB 11.2.4, and in MariaDB Enterprise Server.\n A disconnect automatically releases backup stages.\n* There is no easy way to see what the current stage is.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/backup-commands/backup-stage', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/backup-commands/backup-stage');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (512, 26, 'Storage Snapshots and BACKUP STAGE Statements', 'Description\n-----------\n\nThe BACKUP STAGE statements are a set of statements to make it possible to make an efficient external backup tool. These commands could even be used by tools that perform backups by taking a snapshot of a file system, SAN, or some other kind of storage device.\n\nGeneric Backup Process with Storage Snapshots\n\nA tool that backs up MariaDB by taking a snapshot of a file system, SAN, or some other kind of storage device could use each BACKUP STAGE command in the following way:\n\n First, execute the following:\n\n``sql\nBACKUP STAGE START\nBACKUP STAGE BLOCK_COMMIT\n`\n\n Then, take the snapshot.\n* Then, execute the following:\n\n`sql\nBACKUP STAGE END\n`\n\nThe above ensures that all non-transactional tables are properly flushed to disk before the snapshot is done. Using BACKUP STAGE commands is also more efficient than using the FLUSH TABLES WITH READ LOCK command as the above set of commands will not block or be blocked by write operations to transactional tables.\n\nNote that when the backup is completed, one should delete all files with the "#sql" prefix, as these are files used by concurrent running ALTER TABLE`. Note that InnoDB will on server restart automatically delete any tables with the "#sql" prefix.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/backup-commands/storage-snapshots-and-backup-stage-commands', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/backup-commands/storage-snapshots-and-backup-stage-commands');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (513, 26, 'BINLOG', 'Syntax\n------\n\nBINLOG ''str''\n\nDescription\n-----------\n\nBINLOG is an internal-use statement. It is generated by the mariadb-binlog program as the printable representation of certain events in binary log files. The ''str'' value is a base 64-encoded\\\nstring that the server decodes to determine the data change indicated by the\\\ncorresponding event.\n\nThis statement requires the BINLOG REPLAY privilege.\n\nThis statement requires the SUPER privilege.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/binlog', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/binlog');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (514, 26, 'CACHE INDEX', 'Syntax\n------\n\nCACHE INDEX                      \n  tbl_index_list [, tbl_index_list] ...\n  IN key_cache_name                    \n\ntbl_index_list:\n  tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\nDescription\n-----------\n\nThe CACHE INDEX statement assigns table indexes to a specific key\\\ncache. It is used only for MyISAM tables.\n\nA default key cache exists and cannot be destroyed. To create more key caches, the key_buffer_size server system variable.\n\nThe associations between tables indexes and key caches are lost on server restart. To recreate them automatically, it is necessary to configure caches in a configuration file and include some CACHE INDEX (and optionally LOAD INDEX) statements in the init file.\n\nExamples\n--------\n\nCACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table   | Op                 | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status   | OK       |\n| test.t2 | assign_to_keycache | status   | OK       |\n| test.t3 | assign_to_keycache | status   | OK       |\n+---------+--------------------+----------+----------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/cache-index', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/cache-index');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (515, 26, 'DESCRIBE', 'Syntax\n------\n\n{DESCRIBE | DESC} tbl_name [col_name | wild]\n\nDescription\n-----------\n\nDESCRIBE provides information about the columns in a table.It is a shortcut for SHOW COLUMNS FROM.These statements also display information for views.\n\ncol_name can be a column name, or a string containing theSQL "%" and "_" wildcard characters toobtain output only for the columns with names matching the string. There is noneed to enclose the string within quotes unless it contains spaces or otherspecial characters.\n\n``sql\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | YES  |     | NULL    |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | YES  |     | NULL    |                |\n+------------+----------+------+-----+---------+----------------+\n``\n\nThe description for SHOW COLUMNS providesmore information about the output columns.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/describe', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/describe');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (516, 26, 'FLUSH QUERY CACHE', 'Description\n-----------\n\nYou can defragment the query cache to better utilize its memory with the FLUSH QUERY CACHE statement. The statement does not remove any queries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the query cache.\\\nThe FLUSH TABLES statement also does this.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush-query-cache', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush-query-cache');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (517, 26, 'FLUSH TABLES FOR EXPORT', 'Syntax\n------\n\nFLUSH TABLE[S] table_name [, table_name] FOR EXPORT\n\nDescription\n-----------\n\nFLUSH TABLES ... FOR EXPORT flushes changes to the specified tables to disk so that binary copies can be made while the server is still running. This works for Archive, Aria, CSV, InnoDB, MyISAM and MERGE tables.\n\nThe table is read locked until you issue UNLOCK TABLES.\n\nIf a storage engine does not support FLUSH TABLES FOR EXPORT, a 1031 error (SQLSTATE ''HY000'') is produced.\n\nIf FLUSH TABLES ... FOR EXPORT is in effect in the session, the following statements will produce an error if attempted:\n\n FLUSH TABLES WITH READ LOCK\n FLUSH TABLES ... WITH READ LOCK\n FLUSH TABLES ... FOR EXPORT\n Any statement trying to update any table\n\nIf any of the following statements is in effect in the session, attempting FLUSH TABLES ... FOR EXPORT will produce an error.\n\n FLUSH TABLES ... WITH READ LOCK\n FLUSH TABLES ... FOR EXPORT\n LOCK TABLES ... READ\n LOCK TABLES ... WRITE\n\nFLUSH FOR EXPORT is not written to the binary log.\n\nThis statement requires the RELOAD and the LOCK TABLES privileges.\n\nIf one of the specified tables cannot be locked, none of the tables will be locked.\n\nIf a table does not exist, an error like the following will be produced:\n\n``\nERROR 1146 (42S02): Table ''test.xxx'' doesn''t exist\n`\n\nIf a table is a view, an error like the following will be produced:\n\n`\nERROR 1347 (HY000): ''test.v'' is not BASE TABLE\n``\n\nExamples\n--------\n\nFLUSH TABLES test.t1 FOR EXPORT;\nCopy files related to the table (see below)\nUNLOCK TABLES;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush-tables-for-export', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush-tables-for-export');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (518, 26, 'FLUSH', 'Syntax\n------\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n    flush_option [, flush_option] ...\n\nDescription\n-----------\n\nThe FLUSH statement clears or reloads various internal caches used by MariaDB. To execute FLUSH, you must have the RELOAD privilege. See GRANT.\n\nThe RESET statement is similar to FLUSH. See RESET.\n\nYou cannot issue a FLUSH statement from within a stored function or a trigger. Doing so within a stored procedure is permitted, as long as it is not called by a stored function or trigger. See Stored Routine Limitations, Stored Function Limitations and Trigger Limitations.\n\nIf a listed table is a view, an error like the following will be produced:\n\n``\nERROR 1347 (HY000): ''test.v'' is not BASE TABLE\n`\n\nBy default, FLUSH statements are written to the binary log and will be replicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) ensures that the statement is not written to the binary log. The different flush options are:\n\n| Option                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| CHANGED_PAGE_BITMAPS                              | XtraDB only. Internal command used for backup purposes. See the Information Schema CHANGED_PAGE_BITMAPS Table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| CLIENT_STATISTICS                                  | Reset client statistics (see SHOW CLIENT_STATISTICS).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| DES_KEY_FILE                                      | Reloads the DES key file (Specified with the --des-key-file startup option).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| HOSTS                                               | Flush the hostname cache (used for converting ip to host names and for unblocking blocked hosts. See max_connect_errors and performance_schema.host_cache                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| INDEX_STATISTICS                                   | Reset index statistics (see SHOW INDEX_STATISTICS).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| ERROR                                               | Closes and reopens the error log file to which the server is writing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| \\[ERROR \\| ENGINE \\| GENERAL \\| SLOW \\| RELAY] LOGS | Close and reopen the specified log type, or all log types if none are specified. FLUSH RELAY LOGS [connection-name] can be used to flush the relay logs for a specific connection. Only one connection can be specified per FLUSH command. See multi-source replication. FLUSH ENGINE LOGS deletes all unneeded Aria redo logs. FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains) can be used to discard obsolete GTID domains from the server''s binary log state. In order for this to be successful, no event group from the listed GTID domains can be present in existing binary log files. If some still exist, then they must be purged prior to executing this statement. If the statement completes successfully,  it also rotates the binary log. |\n| BINARY LOGS                                         | FLUSH BINARY LOGS rotates the current binary log.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| BINARY LOGS DELETE_DOMAIN_ID=_list-of-domains_    | FLUSH BINARY LOGS DELETE_DOMAIN_ID can be used to discard obsolete GTID domains from the server''s binary log state. In order for this to be successful, no event group from the listed GTID domains can be present in existing binary log files. If some still exist, then they must be purged prior to executing this command. If the command completes successfully, then it also rotates the binary log.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| MASTER                                              | Deprecated option, use RESET MASTER instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| PRIVILEGES                                          | Reload all privileges from the privilege tables in the mysql database. If the server is started with --skip-grant-table option, this will activate the privilege tables again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| QUERY CACHE                                         | Defragment the query cache to better utilize its memory. If you want to reset the query cache, you can do it with RESET QUERY CACHE.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| QUERY_RESPONSE_TIME                               | See the QUERY_RESPONSE_TIME plugin.\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (519, 26, 'HELP Command', 'Syntax\n------\n\nHELP search_string\n\nDescription\n-----------\n\nThe HELP command can be used in any MariaDB client, such as the mariadb command-line client, to get basic syntax help and a short description for most commands and functions.\n\nIf you provide an argument to the HELP command, the mariadb client uses it as a search string to access server-side help. The proper operation of this command requires that the help tables in the mysql database be initialized with help topic information.\n\nIf there is no match for the search string, the search fails. Use HELP contents to see a list of the help categories:\n\n``sql\nHELP contents\nYou asked for help about help category: "Contents"\nFor more information, type ''help <item>'', where <item> is one of the following\ncategories:\n   Account Management\n   Administration\n   Compound Statements\n   Data Definition\n   Data Manipulation\n   Data Types\n   Functions\n   Functions and Modifiers for Use with GROUP BY\n   Geographic Features\n   Help Metadata\n   Language Structure\n   Plugins\n   Procedures\n   Sequences\n   Table Maintenance\n   Transactions\n   User-Defined Functions\n   Utility\n`\n\nIf a search string matches multiple items, MariaDB shows a list of matching topics:\n\n`sql\nHELP drop\nMany help items for your request exist.\nTo make a more specific request, please type ''help <item>'',\nwhere <item> is one of the following\ntopics:\n   ALTER TABLE\n   DROP DATABASE\n   DROP EVENT\n   DROP FUNCTION\n   DROP FUNCTION UDF\n   DROP INDEX\n   DROP PACKAGE\n   DROP PACKAGE BODY\n   DROP PROCEDURE\n   DROP ROLE\n   DROP SEQUENCE\n   DROP SERVER\n   DROP TABLE\n   DROP TRIGGER\n   DROP USER\n   DROP VIEW\n`\n\nThen you can enter a topic as the search string to see the help entry for that topic.\n\nThe help is provided with the MariaDB server and makes use of four help tables found in the mysql database: help_relation, help_topic, help_category and help_keyword. These tables are populated by the mariadb-install-db or fill_help_table.sql` scripts.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/help-command', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/help-command');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (520, 26, 'KILL', 'Syntax\n------\n\nKILL [HARD | SOFT] { {CONNECTION|QUERY} thread_id | QUERY ID query_id | USER user_name }\n\nDescription\n-----------\n\nEach connection to mariadbd runs in a separate thread. You can see which threads are running with the SHOW PROCESSLIST statement and kill a thread with the KILL thread_id statement.KILL allows the optional CONNECTION orQUERY modifier:\n\n KILL CONNECTION is the same as KILL with no modifier: It terminates the connection associated with the given thread or query id.\n KILL QUERY terminates the statement that the connection thread_id is currently executing, but leaves the connection itself intact.\n KILL QUERY ID terminates the query by query_id, leaving the connection intact.\n\nIf a connection is terminated that has an active transaction, the transaction  is rolled back. If only a query is killed, the current transaction stays active. See also idle_transaction_timeout.\n\nIf you have the PROCESS privilege, you can see all threads.\n\nIf you have the CONNECTION ADMIN privilege, you can kill all threads and statements. Otherwise, you can see and kill only your own threads and statements.\n\nIf you have the SUPER privilege, the CONNECTION ADMIN privilege, you can kill all threads and statements. Otherwise, you can see and kill only your own threads and statements.\n\nKilling queries that repair or create indexes on MyISAM and Aria tables may result in corrupted tables. Use the SOFT option to avoid this.\n\nThe HARD option (default) kills a statement as soon as possible. If you useSOFT,  critical operations that may leave a table in an inconsistent state are not interrupted. Such operations include REPAIR and INDEX creation for MyISAM and Aria tables (REPAIR TABLE, OPTIMIZE TABLE).\n\nKILL ... USER username kills all connections and queries for a given user. USER can be specified in one of the following ways:\n\n username (kill without regard to hostname)\n username@hostname\n CURRENT_USER or CURRENT_USER()\n\nIf you specify a thread id and that thread does not exist, you get the following error:\n\n``\nERROR 1094 (HY000): Unknown thread id: <thread_id>\n`\n\nIf you specify a query id that doesn''t exist, you get the following error:\n\n`\nERROR 1957 (HY000): Unknown query id: <query_id>\n`\n\nHowever, if you specify a user name, no error is issued for non-connected (or even non-existing) users. To check if the connection/query has been killed, you can use the ROW_COUNT() function.\n\nA client whose connection is killed receives the following error:\n\n`\nERROR 1317 (70100): Query execution was interrupted\n`\n\nTo obtain a list of existing sessions, use the SHOW PROCESSLIST statement or query the Information Schema PROCESSLIST table.\n\nYou cannot use KILL with the Embedded MariaDB Server library because the embedded server merely runs inside the threads of the host application. It does not create any connection threads of its own.\n\nNote: You can also use mariadb-admin kill thread_id [,thread_id...] to kill connections. To get a list of running queries,use mariadb-admin processlist`. See mariadb-admin.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/kill', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/kill');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (521, 26, 'INSTALL PLUGIN', 'Syntax\n------\n\nINSTALL PLUGIN [IF NOT EXISTS] plugin_name SONAME ''plugin_library''\n\nDescription\n-----------\n\nThis statement installs an individual plugin from the specified library. To install the whole library (which could be required), use INSTALL SONAME. See also Installing a Plugin.\n\nplugin_name is the name of the plugin as defined in theplugin declaration structure contained in the library file. Plugin names arenot case sensitive. For maximal compatibility, plugin names should be limitedto ASCII letters, digits, and underscore, because they are used in C sourcefiles, shell command lines, M4 and Bourne shell scripts, and SQL environments.\n\nplugin_library is the name of the shared library thatcontains the plugin code. The file name extension can be omitted (which makes the statement look the same on all architectures).\n\nThe shared library must be located in the plugin directory (that is,the directory named by the plugin_dir system variable). The library must be in the plugin directory itself, not in a subdirectory. Bydefault, plugin_dir is plugin directory under the directory named bythe pkglibdir configuration variable, but it can be changed by settingthe value of plugin_dir at server startup. For example, setits value in a my.cnf file:\n\n``ini\n[mariadbd]\nplugin_dir=/path/to/plugin/directory\n`\n\nIf the value of plugin_dir is a relative path name, it istaken to be relative to the base directory (the value of the basedir system variable).\n\nINSTALL PLUGIN adds a line to the mysql.plugin table thatdescribes the plugin. This table contains the plugin name and library filename.\n\nINSTALL PLUGIN causes the server to readoption (my.cnf) files just as during server startup. This enables the plugin topick up any relevant options from those files. It is possible to add pluginoptions to an option file even before loading a plugin (if the loose prefix isused). It is also possible to uninstall a plugin, edit my.cnf, and install theplugin again. Restarting the plugin this way enables it to the new optionvalues without a server restart.\n\nINSTALL PLUGIN also loads and initializes the plugin code tomake the plugin available for use. A plugin is initialized by executing itsinitialization function, which handles any setup that the plugin must performbefore it can be used.\n\nTo use INSTALL PLUGIN, you must have the INSERT privilege for the mysql.plugin table.\n\nAt server startup, the server loads and initializes any plugin that islisted in the mysql.plugin table. This means that a plugin is installedwith INSTALL PLUGIN only once, not every time the serverstarts. Plugin loading at startup does not occur if the server is started withthe --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization functionfor each plugin that is loaded so that the plugin has a chance toperform any final cleanup.\n\nIf you need to load plugins for a single server startup when the--skip-grant-tables option is given (which tells the servernot to read system tables), use the--plugin-load mariadbd option.\n\nIF NOT EXISTS\n\nWhen the IF NOT EXISTS` clause is used, MariaDB will return a note instead of an error if the specified plugin already exists. See SHOW WARNINGS.\n\nExamples\n--------\n\nINSTALL PLUGIN sphinx SONAME ''ha_sphinx.so'';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/install-plugin', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/install-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (522, 26, 'INSTALL SONAME', 'Syntax\n------\n\nINSTALL SONAME ''plugin_library''\n\nDescription\n-----------\n\nThis statement is a variant of INSTALL PLUGIN. It installs all plugins from a given plugin_library. See INSTALL PLUGIN for details.\n\nplugin_library is the name of the shared library thatcontains the plugin code. The file name extension (forexample, libmyplugin.so or libmyplugin.dll) can be omitted (which makes the statement look the same on all architectures).\n\nThe shared library must be located in the plugin directory (that is,the directory named by the plugin_dir system variable). The library must be in the plugin directory itself, not in a subdirectory. Bydefault, plugin_dir is plugin directory under the directory named bythe pkglibdir configuration variable, but it can be changed by settingthe value of plugin_dir at server startup. For example, setits value in a my.cnf file:\n\n``ini\n[mariadbd]\nplugin_dir=/path/to/plugin/directory\n`\n\nIf the value of plugin_dir is a relative path name, it istaken to be relative to the MySQL base directory (the value of the basedirsystem variable).\n\nINSTALL SONAME adds one or more lines to the mysql.plugin table thatdescribes the plugin. This table contains the plugin name and library filename.\n\nINSTALL SONAME causes the server to readoption (my.cnf) files just as during server startup. This enables the plugin topick up any relevant options from those files. It is possible to add pluginoptions to an option file even before loading a plugin (if the loose prefix isused). It is also possible to uninstall a plugin, edit my.cnf, and install theplugin again. Restarting the plugin this way enables it to the new optionvalues without a server restart.\n\nINSTALL SONAME also loads and initializes the plugin code tomake the plugin available for use. A plugin is initialized by executing itsinitialization function, which handles any setup that the plugin must performbefore it can be used.\n\nTo use INSTALL SONAME, you must have the INSERT privilege for the mysql.plugin table.\n\nAt server startup, the server loads and initializes any plugin that islisted in the mysql.plugin table. This means that a plugin is installedwith INSTALL SONAME only once, not every time the serverstarts. Plugin loading at startup does not occur if the server is started withthe --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization functionfor each plugin that is loaded so that the plugin has a chance toperform any final cleanup.\n\nIf you need to load plugins for a single server startup when the--skip-grant-tables option is given (which tells the servernot to read system tables), use the--plugin-load` mariadbd option.\n\nIf you need to install only one plugin from a library, use the INSTALL PLUGIN statement.\n\nExamples\n--------\n\nINSTALL SONAME ''locales'';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/install-soname', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/install-soname');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (523, 26, 'UNINSTALL PLUGIN', 'Syntax\n------\n\nUNINSTALL PLUGIN [IF EXISTS] plugin_name\n\nDescription\n-----------\n\nThis statement removes a single installed plugin. To uninstall the whole library which contains the plugin, use UNINSTALL SONAME. You cannot uninstall a plugin if any table that uses it is open.\n\nplugin_name must be the name of some plugin that is listedin the mysql.plugin table. The server executes the plugin''s deinitializationfunction and removes the row for the plugin from the mysql.plugintable, so that subsequent server restarts will not load and initializethe plugin. UNINSTALL PLUGIN does not remove the plugin''sshared library file.\n\nTo use UNINSTALL PLUGIN, you must have the DELETE privilege for the mysql.plugin table.\n\nIF EXISTS\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an error if the plugin does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nUNINSTALL PLUGIN example;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/uninstall-plugin', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/uninstall-plugin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (524, 26, 'UNINSTALL SONAME', 'Syntax\n------\n\nUNINSTALL SONAME  [IF EXISTS] ''plugin_library''\n\nDescription\n-----------\n\nThis statement is a variant of UNINSTALL PLUGIN statement, that removes all plugins belonging to a specified plugin_library. See UNINSTALL PLUGIN for details.\n\nplugin_library is the name of the shared library thatcontains the plugin code. The file name extension (forexample, libmyplugin.so or libmyplugin.dll) can be omitted (which makes the statement look the same on all architectures).\n\nTo use UNINSTALL SONAME, you must have the DELETE privilege for the mysql.plugin table.\n\nIF EXISTS\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an error if the plugin library does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nUNINSTALL SONAME ''ha_xtradb'';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/uninstall-soname', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/plugin-sql-statements/uninstall-soname');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (525, 26, 'PURGE BINARY LOGS', 'Syntax\n------\n\nPURGE { BINARY | MASTER } LOGS\n    { TO ''log_name'' | BEFORE datetime_expr }\n\nDescription\n-----------\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed in the log index file prior to the specified log file name ordate. BINARY and MASTER are synonyms.Deleted log files also are removed from the list recorded in the index file, sothat the given log file becomes the first in the list.\n\nThe datetime expression is in the format ''YYYY-MM-DD hh:mm:ss''.\n\nIf a slave is active but has yet to read from a binary log file you attempt to delete, the statement will fail with an error. However, if the slave is not connected and has yet to read from a log file you delete, the file will be deleted, but the slave will be unable to continue replicating once it connects again.\n\nThis statement has no effect if the server was not started with the --log-bin option to enable binary logging.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which files they are reading, use SHOW SLAVE STATUS. You can only delete the files that are older than the oldest file that is used by the slaves.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which files they are reading, use SHOW SLAVE STATUS. You can only delete the files that are older than the oldest file that is used by the slaves.\n\nTo delete all binary log files, use RESET MASTER.To move to a new log file (for example if you want to remove the current log file), use FLUSH LOGS before you execute PURGE LOGS.\n\nIf the expire_logs_days server system variable is not set to 0, the server automatically deletes binary log files after the given number of days. From MariaDB 10.6, the binlog_expire_logs_seconds variable allows more precise control over binlog deletion, and takes precedence if both are non-zero.\n\nRequires the BINLOG ADMIN privilege.\n\nRequires the SUPER privilege.\n\nExamples\n--------\n\nPURGE BINARY LOGS TO ''mariadb-bin.000063'';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/purge-binary-logs', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/purge-binary-logs');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (526, 26, 'Replication Statements', 'Description\n-----------\n\nThe terms _master_ and _slave_ have historically been used in replication, and MariaDB has begun the process of adding _primary_ and _replica_ synonyms. The old terms will continue to be used to maintain backward compatibility - see MDEV-18777 to follow progress on this effort.\n\nchange-master-to.md\n\nreset-master.md\n\nreset-replica.md\n\nset-global-sql_slave_skip_counter.md\n\nstart-replica.md\n\nstop-replica.md\n\nlegacy-replication-statements\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/README', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/README');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (527, 26, 'CHANGE MASTER TO', 'Description\n-----------\n\nThe CHANGE MASTER TO statement sets up a replication slave server to connect to a specific master server and defines the replication coordinates (binary log file and position or GTID) and connection parameters (host, user, password, port, SSL options, etc.). When executed, the slave updates its internal replication metadata accordingly.\n\nSyntax\n\n``sql\nCHANGE MASTER [''connection_name''] TO master_def  [, master_def] ... \n  [FOR CHANNEL ''channel_name'']\n\nmaster_def:\n    MASTER_BIND = ''interface_name''\n  | MASTER_HOST = ''host_name''\n  | MASTER_USER = ''user_name''\n  | MASTER_PASSWORD = ''password''\n  | MASTER_PORT = port_num\n  | MASTER_CONNECT_RETRY = {interval | DEFAULT}\n  | MASTER_HEARTBEAT_PERIOD = {interval | DEFAULT}\n  | MASTER_LOG_FILE = ''master_log_name''\n  | MASTER_LOG_POS = master_log_pos\n  | RELAY_LOG_FILE = ''relay_log_name''\n  | RELAY_LOG_POS = relay_log_pos\n  | MASTER_DELAY = interval\n  | MASTER_SSL = {0 | 1 | DEFAULT}\n  | MASTER_SSL_CA = {''ca_file_name'' | DEFAULT}\n  | MASTER_SSL_CAPATH = {''ca_directory_name'' | DEFAULT}\n  | MASTER_SSL_CERT = {''cert_file_name'' | DEFAULT}\n  | MASTER_SSL_CRL = {''crl_file_name'' | DEFAULT}\n  | MASTER_SSL_CRLPATH = {''crl_directory_name'' | DEFAULT}\n  | MASTER_SSL_KEY = {''key_file_name'' | DEFAULT}\n  | MASTER_SSL_CIPHER = {''cipher_list'' | DEFAULT}\n  | MASTER_SSL_VERIFY_SERVER_CERT = {0 | 1 | DEFAULT}\n  | MASTER_USE_GTID = {current_pos | slave_pos | no | DEFAULT}\n  | MASTER_DEMOTE_TO_SLAVE = bool\n  | IGNORE_SERVER_IDS = (server_id_list)\n  | DO_DOMAIN_IDS = ([N,..])\n  | IGNORE_DOMAIN_IDS = ([N,..])\n  | MASTER_RETRY_COUNT = {long | DEFAULT}\n`\n\nNote: The value is extracted from the corresponding server option or system variable that support DEFAULT. This allows you to reset a replication configuration parameter to its server-level configuration without providing an explicit value.\n\nReplication Configuration\n\nCHANGE MASTER is used on a slave to set up or change replication settings for connecting to the master.\n\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical to using the channel_name directly after CHANGE MASTER.\n\nFOR CHANNEL is not available.\n\nMulti-Source Replication\n\nIf you are using multi-source replication, then you need to specify a connection name when you execute CHANGE MASTER. There are two ways to do this:\n\n Setting the default_master_connection system variable prior to executing CHANGE MASTER.\n Setting the connection_name parameter when executing CHANGE MASTER.\n\ndefault_master_connection\n\n`sql\nSET default_master_connection = ''gandalf'';\nSTOP SLAVE;\nCHANGE MASTER TO \n   MASTER_PASSWORD=''new3cret'';\nSTART SLAVE;\n`\n\nconnection_name\n\n`sql\nSTOP SLAVE ''gandalf'';\nCHANGE MASTER ''gandalf'' TO \n   MASTER_PASSWORD=''new3cret'';\nSTART SLAVE ''gandalf'';\n`\n\nOptions\n\nUsing Configurable Defaults\n\nStarting with MariaDB 12.3, replication connection parameters can be set at the server level (for example, in configuration files like my.cnf or via command-line options) and reused across replication channels.\n\nWhen an option in CHANGE MASTER TO is set to DEFAULT, the value is obtained from the corresponding server option (e.g., options defined in configuration files like my.cnf or provided on the command line). Instead of keeping a fixed value, the replication channel derives the value from the appropriate server option when DEFAULT is selected.\n\n<table><thead><tr><th width="224">CHANGE MASTER Option</th><th width="230">System Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>MASTER_CONNECT_RETRY</code></td><td><code>--master-connect-retry</code></td><td>The interval to wait between connection retry attempts.</td></tr><tr><td><code>MASTER_RETRY_COUNT</code></td><td><code>--master-retry-count</code></td><td>Number of connection attempts before stopping.</td></tr><tr><td><code>MASTER_HEARTBEAT_PERIOD</code></td><td><code>--master-heartbeat-period</code></td><td>Interval between replication heartbeats.</td></tr><tr><td><code>MASTER_SSL</code></td><td><code>--master-ssl</code></td><td>Enables or disables TLS for the connection.</td></tr><tr><td><code>MASTER_SSL_CA</code></td><td><code>--master-ssl-ca</code></td><td>Path to the Certificate Authority (CA) file.</td></tr><tr><td><code>MASTER_SSL_CERT</code></td><td><code>--master-ssl-cert</code></td><td>Path to the client certificate file.</td></tr><tr><td><code>MASTER_SSL_KEY</code></td><td><code>--master-ssl-key</code></td><td>Path to the client private key file.</td></tr><tr><td><code>MASTER_SSL_CAPATH</code></td><td><code>--master-ssl-capath</code></td><td>Path to the directory containing CA certificates.</td></tr><tr><td><code>MASTER_SSL_VERIFY_SERVER_CERT</code></td><td><code>--master-ssl-verify-server-cert</code></td><td>Enable verification of the master''s certificate.</td></tr><tr><td><code>MASTER_SSL_CRL</code></td><td><code>--master-ssl-crl</code></td><td>Path to the Certificate Revocation List (CRL) file.</td></tr><tr><td><code>MASTER_SSL_CRLPATH</code></td><td><code>--master-ssl-crlpath</code></td><td>Path to the directory containing CRL files.</td></tr><tr><td><code>MASTER_SSL_CIPHER</code></td><td><code>--master-ssl-cipher</code></td><td>List of permitted TLS ciphers.</td></tr><tr><td><code>MASTER_USE_GTID</code></td><td><code>--master-use-gtid</code></td><td>Setting for Global Transaction ID (GTID) mode.</td></tr></tbody></table>\n\nFor example, a configuration file can specify default values:\n\n`\nDefaults replication connection options\nmaster_ssl_ca   = /etc/mysql/ssl/ca.pem\nmaster_ssl_cert = /etc/mysql/ssl/client-cert.pem\nmaster_ssl_key  = /etc/mysql/ssl/client-key.pem\nmaster_use_gtid = slave_pos\n`\n\nThese values can then be reused by specifying DEFAULT:\n\n`\n-- Setting up a specific channel using global defaults\nCHANGE MASTER ''primary_node_1'' TO\n  MASTER_HOST = ''10.0.0.5'',\n  MASTER_SSL_CA = DEFAULT,\n  MASTER_SSL_CERT = DEFAULT,\n  MASTER_SSL_KEY = DEFAULT,\n  MASTER_USE_GTID = DEFAULT;\n\nSTART SLAVE ''primary_node_1'';\n`\n\nIf an option is explicitly set in CHANGE MASTER TO, the value overrides the corresponding server option. The replication channel receives the current server-level value if DEFAULT is used.\n\nValues set to DEFAULT are fixed dynamically, thus changes to server options (for example, after a restart) are automatically reflected, whereas explicitly defined values remain unchanged.\n\nBehavior and Persistence\n\nWhen DEFAULT is used, the option is stored in the replication metadata as DEFAULT instead of a specific value. The new value will be used automatically if the corresponding server option changes (for instance, after a server restart).\n\nChanges to server settings have no effect on an explicit value that is provided instead of DEFAULT. When a CHANGE MASTER option is not explicitly set, it acts as DEFAULT.\n\nConfiguration Precedence\n\nValues explicitly defined in CHANGE MASTER TO take precedence over server settings.\n\nThe replication channel can inherit values from server-level configuration rather than overriding them when the DEFAULT keyword is used.\n\nAutoset Options\n\nThe following options can override manual defaults:\n\n --autoset-master-heartbeat-period\n --autoset-master-use-gtid\n\nThese options determine values automatically and may override --master- settings.\n\nConnection Options\n\nMASTER_USER\n\nThe MASTER_USER option for CHANGE MASTER defines the user account that the slave will use to connect to the master.\n\nThis user account will need the REPLICATION SLAVE privilege on the master.\n\nThis user account will need the REPLICATION SLAVE privilege on the master.\n\nFor example:\n\n`sql\nSTOP SLAVE;\nCHANGE MASTER TO\n   MASTER_USER=''repl'',\n   MASTER_PASSWORD=''new3cret'';\nSTART SLAVE;\n`\n\nThe maximum length of the MASTER_USER string is 128 characters.\n\nThe maximum length of the MASTER_USER string is 96 characters.\n\nMASTER_PASSWORD\n\nThe MASTER_PASSWORD option for CHANGE MASTER defines the password that the slave will use to connect to the master as the user account defined by the MASTER_USER option.\n\nFor example:\n\n`sql\nSTOP SLAVE;\nCHANGE MASTER TO \n   MASTER_PASSWORD=''new3cret'';\nSTART SLAVE;\n`\n\nThe maximum length of the MASTER_PASSWORD string is 32 characters. The effective maximum length of the string depends on how many bytes are used per character and can be up to 96 characters.\n\nDue to MDEV-29994, the password can be silently truncated to 41 characters when MariaDB is restarted. For this reason, it is recommended to use a password that is shorter than this.\n\nMASTER_HOST\n\nThe MASTER_HOST option for CHANGE MASTER defines the hostname or IP address of the master.\n\nIf you set the value of the MASTER_HOST option to the empty string, then that is not the same as not setting the option''s value at all. If you set the value of the MASTER_HOST option to the empty string, then the CHANGE MASTER command will fail with an error.\n\nIf you set the value of the MASTER_HOST option to the empty string, then that is not the same as not setting the option''s value at all. If you set the value of the MASTER_HOST option to the empty string, then the CHANGE MASTER command will fail with an error. In MariaDB 5.3 and before, if you set the value of the MASTER_HOST option to the empty string, then the CHANGE MASTER command would succeed, but the subsequent START SLAVE command would fail.\n\nFor example:\n\n`sql\nSTOP SLAVE;\nCHANGE MASTER TO\n   MASTER_HOST=''dbserver1.example.com'',\n   MASTER_USER=''repl'',\n   MASTER_PASSWORD=''new3cret'',\n   MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n`\n\nIf you set the value of the MASTER_HOST option in a CHANGE MASTER command, then the slave assumes that the master is different from before, even if you set the value of this option to the same value it had previously. In this scenario, the slave will consider the old values for the master''s binarylog file name and position to be invalid for the new master. As a side effect, if you do not explicitly set the values of the MASTER_LOG_FILE and MASTER_LOG_POS options in the statement, then the statement will be implicitly appended with MASTER_LOG_FILE='''' and MASTER_LOG_POS=4. However, if you enable GTID mode for replication by setting the MASTER_USE_GTID option to some value other than no in the statement, then these values will effectively be ignored anyway.\n\nSlaves cannot connect to primaries using Unix socket files or Windows named pipes. The slave must connect to the master using TCP/IP.\n\nThe maximum length of the MASTER_HOST string is 255 characters.\n\nThe maximum length of the MASTER_HOST string is 60 characters.\n\nMASTER_PORT\n\nThe MASTER_PORT option for CHANGE MASTER defines the TCP/IP port of the master.\n\nFor example:\n\n`sql\nSTOP SLAVE;\nCHANGE MASTER TO\n   MASTER_HOST=''dbserver1.example.com'',\n   MASTER_PORT=3307,\n   MASTER_USER=''repl'',\n   MASTER_PASSWORD=''new3cret'',\n   MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n`\n\nIf you set the value of the MASTER_PORT option in a CHANGE MASTER command, then the slave assumes that the master is different from before, even if you set the value of this option to the same value it had previously. In this scenario, the slave will consider the old values for the master''s binary log file name and position to be invalid for the new master. As a side effect, if you do not explicitly set the values of the MASTER_LOG_FILE and MASTER_LOG_POS options in the statement, then the statement will be implicitly appended with MASTER_LOG_FILE='''' and MASTER_LOG_POS=4. However, if you enable GTID mode for replication by setting the MASTER_USE_GTID option to some value other than no in the statement, then these values will effectively be ignored anyway.\n\nSlaves cannot connect to primaries using Unix socket files or Windows named pipes. The slave must connect to the master using TCP/IP.\n\nMASTER_CONNECT_RETRY\n\nThe MASTER_CONNECT_RETRY option for CHANGE MASTER defines how many seconds that the slave will wait between connection retries. The default is 60.\n\n`sql\nSTOP SLAVE;\nCHANGE MASTER TO \n   MASTER_CONNECT_RETRY=20;\nSTART SLAVE;\n`\n\n> Starting with MariaDB 12.3, this option accepts the DEFAULT keyword. When set to DEFAULT, the value is taken from the corresponding server option (for example, --master-connect-retry defined in the configuration files or on the command line).\\\n> \\\n> The option can now be set to 0, which disables the wait between connection retries.\n\nMASTER_RETRY_COUNT\n\nThe MASTER_RETRY_COUNT option limits the number of connection attempts (i.e., Connects_Tried in SHOW SLAVE STATUS). For example:\n\n`sql\nSTOP SLAVE;\nCHANGE MASTER TO\n  MASTER_RETRY_COUNT=1; # attempt only once; do not retry if it fails\nSTART SLAVE;\n`\n\nSetting this option resets the Connects_Tried statistic in SHOW SLAVE STATUS to 0.\n\nThe default is the --master-retry-count option, which can be set either on the command-line or in a server option group in an option file prior to starting up the server. For example:\n\nThe MASTER_RETRY_COUNT option for CHANGE MASTER is only supported by MariaDB 12.0.1 and later and by MySQL. Please use the --master-retry-count option instead, which be set either on the command-line or in a server option group in an option file prior to starting up the server. For example:\n\n`ini\n[mariadb]\n...\nmaster_retry_count=4294967295\n`\n\nThe maximum value is 18446744073709551615 (64-bit). Before MariaDB 12.3, the maximum value for Windows was 4294967295.\n\n> Starting with MariaDB 12.3, this option accepts the DEFAULT keyword. When set to DEFAULT, the value is taken from the corresponding server option (for example, --master-retry-count).\n>\n> The option can now be set to 0, allowing the slave to retry indefinitely.\n> \\\n> When it is set to 1, the connection attempt is only made once, hence disabling retries.\n\nMASTER_BIND\n\nThe MASTER_BIND option for CHANGE MASTER is only supported by MySQL 5.6.2 and later and by MySQL NDB Cluster 7.3.1 and later. This option is not supported by MariaDB. See MDEV-19248 for more information.\n\nThe MASTER_BIND option for CHANGE MASTER can be used on slaves that have multiple network interfaces to choose which network interface the slave will use to connect to the master.\n\nMASTER_HEARTBEAT_PERIOD\n\nThe MASTER_HEARTBEAT_PERIOD option for CHANGE MASTER can be used to set the interval in seconds between replication heartbeats. Whenever the master''s binary log is updated with an event, the waiting period for the next heartbeat is reset.\n\nThis option''s _interval_ argument has the following characteristics:\n\n It is a decimal value with a range of 0 to 4294967.295 seconds.\n It has a resolution of hundredths of a second.\n Its smallest valid non-zero value is 0.001.\n Its default value is the value of the slave_net_timeout system variable divided by 2.\n If it''s set to 0, then heartbeats are disabled.\n\nHeartbeats are sent by the master only if there are no unsent events in the binary log file for a period longer than the interval.\n\n> Starting with MariaDB 12.3, this option accepts the DEFAULT keyword. When set to DEFAULT, the value is taken from the corresponding server opti\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/change-master-to');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (528, 26, 'RESET REPLICA', 'Description\n-----------\n\nAlias for RESET SLAVE\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-reset-slave', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-reset-slave');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (529, 26, 'SHOW REPLICA HOSTS', 'Description\n-----------\n\nAlias for SHOW SLAVE HOSTS\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-show-slave-hosts', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-show-slave-hosts');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (530, 26, 'SHOW REPLICA STATUS', 'Description\n-----------\n\nAlias for SHOW SLAVE STATUS\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-show-slave-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-show-slave-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (531, 26, 'START REPLICA', 'Description\n-----------\n\nAlias for START SLAVE\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-start-slave', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-start-slave');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (532, 26, 'STOP REPLICA', 'Description\n-----------\n\nAlias for STOP SLAVE\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-stop-slave', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/legacy-replication-statements/legacy-commands-stop-slave');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (533, 26, 'RESET MASTER', 'Description\n-----------\n\n``sql\nRESET MASTER [TO #]\n`\n\nDeletes all binary log files listed in the index file, resets the binary log index file to be empty, and creates a new binary log file with a suffix of .000001.\n\nIf TO #` is given, then the first new binary log file will start from number #.\n\nThis statement is for use only when the master is started for the first time and should never be used if any slaves are actively replicating from the binary log.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/reset-master', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/reset-master');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (534, 26, 'RESET SLAVE', 'Syntax\n------\n\nRESET { SLAVE | REPLICA } ["connection_name"] [ALL]  [FOR CHANNEL "connection_name"].\n\nDescription\n-----------\n\nRESET SLAVE makes the slave forget its replication position in the master''s binary log. This statement is meant to be used for a clean start. It deletes the master.info and relay-log.info files, all the relay log files, and starts a new relay log file. To use RESET SLAVE, the slave threads must be stopped (use STOP SLAVE if necessary).\n\nNote: All relay log files are deleted, even if they have not been completely executed by the slave SQL thread. (This is a condition likely to exist on a replication slave if you have issued a STOP SLAVE statement or if the slave is highly loaded.)\n\nNote: RESET SLAVE does not reset the globalgtid_slave_pos variable. This means that a slave server configured with CHANGE MASTER TO MASTER_USE_GTID=slave_pos will not receive events with GTIDs occurring before the state saved ingtid_slave_pos. If the intent is to reprocess these events,gtid_slave_pos must be manually reset, e.g., by executing set global gtid_slave_pos="".\n\nConnection information stored in the master.info file is immediately reset using any values specified in the corresponding startup options. This information includes values such as master host, master port, master user, and master password. If the slave SQL thread was in the middle of replicating temporary tables when it was stopped, and RESET SLAVE is issued, these replicated temporary tables are deleted on the slave.\n\nThe ALL also resets the PORT, HOST, USER, and PASSWORD parameters for the slave. If you are using a connection name, it will be permanently deleted it and it will not show up anymore in SHOW ALL SLAVES STATUS.\n\nconnection_name\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless master, or the default master (as specified by the default_master_connection system variable) is intended, connection_name can be omitted. If provided, the RESET SLAVE statement will apply to the specified master. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical to using the channel_name directly after RESET SLAVE.\n\nFOR CHANNEL is not available.\n\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical as using the channel_name directly after RESET SLAVE.\n\nMariaDB starting with 11.6.0\n\nRESET SLAVE resets the Master/Slave_last_event_time and Connects_Tried values (see SHOW SLAVE STATUS).\n\nRESET SLAVE resets the Master/Slave_last_event_time values (see SHOW SLAVE STATUS).\n\nRESET SLAVE does not reset the Master/Slave_last_event_time values (see SHOW SLAVE STATUS).\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/reset-replica', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/reset-replica');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (535, 26, 'SET GLOBAL SQL\\_SLAVE\\_SKIP\\_COUNTER', 'Syntax\n------\n\nSET GLOBAL sql_slave_skip_counter = N\n\nDescription\n-----------\n\nThis statement skips the next N events from the master. This is useful for recovering from replication stops caused by a statement.\n\nIf multi-source replication is used, this statement applies to the default connection. It could be necessary to change the value of the default_master_connection system variable.\n\nNote that, if the event is a transaction, the whole transaction will be skipped. With non-transactional engines, an event is always a single statement.\n\nThis statement is valid only when the slave threads are not running. Otherwise, it produces an error.\n\nThe statement does not automatically restart the slave threads.\n\nExamples\n--------\n\nSHOW SLAVE STATUS \\G\n...\nSET GLOBAL sql_slave_skip_counter = 1;\nSTART SLAVE;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/set-global-sql_slave_skip_counter', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/set-global-sql_slave_skip_counter');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (536, 26, 'START SLAVE', 'Syntax\n------\n\nSTART { SLAVE | REPLICA } ["connection_name"] [thread_type [, thread_type] ... ]\nSTART { SLAVE | REPLICA } ["connection_name"] [SQL_THREAD] UNTIL                \n    MASTER_LOG_FILE = ''log_name'', MASTER_LOG_POS = log_pos \nSTART { SLAVE | REPLICA } ["connection_name"] [SQL_THREAD] UNTIL\n    RELAY_LOG_FILE = ''log_name'', RELAY_LOG_POS = log_pos \nSTART { SLAVE | REPLICA } ["connection_name"] [SQL_THREAD] UNTIL\n    MASTER_GTID_POS = <GTID position> \nSTART ALL { SLAVES | REPLICAS } [thread_type [, thread_type]] \n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nSTART REPLICA is a synonym for START SLAVE.\n\nOnly START SLAVE can be used.\n\nSTART SLAVE or START REPLICA with no thread_type options starts both of the slave threads (see replication) needed to connect with a master setup with CHANGE MASTER TO. The I/O thread reads events from the master server and stores them in the relay log. The SQL thread reads events from the relay log and executes them.\n\nSTART SLAVE requires the REPLICATION SLAVE ADMIN privilege.\n\nSTART SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns without any error. However, even in that case, it might be that the slave threads start and then later stop (for example, because they do not manage to connect to the master or read its binary log, or some other problem). START SLAVE does not warn you about this. You must check the slave''s error log for error messages generated by the slave threads or check that they are running satisfactorily with SHOW SLAVE STATUS (SHOW REPLICA STATUS).\n\nSTART SLAVE UNTIL\n\nSTART SLAVE UNTIL refers to the SQL_THREAD slave position at which the SQL_THREAD replication will halt. If SQL_THREAD isn''t specified, both threads are started.\n\nSTART SLAVE UNTIL master_gtid_pos=xxx is also supported. See Global Transaction ID/START SLAVE UNTIL master_gtid_pos=xxx for more details.\n\nMariaDB starting with 11.3.0\n\nSQL_BEFORE_GTIDS|SQL_AFTER_GTIDS\n\nThe START SLAVE UNTIL statement contains the options SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS to allow control of whether the slave stops before or after a provided GTID state. Its syntax is:\n\n``sql\nSTART SLAVE UNTIL (SQL_BEFORE_GTIDS|SQL_AFTER_GTIDS)="<gtid_list>"\n`\n\nSee Global Transaction ID#SQL_BEFORE_GTIDS/SQL_AFTER_GTIDS for details.\n\nSQL_BEFORE_GTIDS and SQL_AFTER_GTIDS are not available.\n\nconnection_name\n\nIf there is only one nameless master, or the default master (as specified by the default_master_connection system variable) is intended, connection_name can be omitted. If provided, the START SLAVE statement will apply to the specified master. connection_name is case-insensitive.\n\nThe FOR CHANNEL keyword is available for MySQL compatibility. This is identical to using the channel_name directly after START SLAVE.\n\nThe FOR CHANNEL keyword is not available.\n\nSTART ALL SLAVES\n\nSTART ALL SLAVES starts all configured slaves (slaves with master_host not empty) that were not started before. It will give a note` for all started connections. You can check the notes with SHOW WARNINGS.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/start-replica', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/start-replica');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (537, 26, 'STOP SLAVE', 'Syntax\n------\n\nSTOP { SLAVE | REPLICA } ["connection_name"] [thread_type [, thread_type] ... ] \n[FOR CHANNEL "connection_name"]\n\nSTOP ALL { SLAVES | REPLICAS } [thread_type [, thread_type]]\n\nSTOP { SLAVE | REPLICA } ["connection_name"] [thread_type [, thread_type] ... ]\n\nSTOP ALL { SLAVES | REPLICAS } [thread_type [, thread_type]] \n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege, or, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege.\n\nLike START SLAVE, this statement may be used with the IO_THREAD andSQL_THREAD options to name the thread or threads to be stopped. In almost all cases, one never need to use the thread_type options.\n\nSTOP SLAVE waits until any current replication event group affecting one or more non-transactional tables has finished executing (if there is any such replication group), or until the user issues a KILL QUERY or KILL CONNECTION statement.\n\nNote that STOP SLAVE doesn''t delete the connection permanently. Next time you execute START SLAVE or the MariaDB server restarts, the slave connection is restored with it''s original arguments. If you want to delete a connection, you should execute RESET SLAVE.\n\nSTOP ALL SLAVES\n\nSTOP ALL SLAVES stops all your running slaves. It will give you a note for every stopped connection. You can check the notes with SHOW WARNINGS.\n\nconnection_name\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless master, or the default master (as specified by the default_master_connection system variable) is intended, connection_name can be omitted. If provided, the STOP SLAVE statement will apply to the specified master. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n\nThe FOR CHANNEL keyword is available for MySQL compatibility. This is identical as using the channel_name directly after STOP SLAVE.\n\nThe FOR CHANNEL keyword is not available.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/stop-replica', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/replication-statements/stop-replica');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (538, 26, 'RESET', 'Syntax\n------\n\nRESET reset_option [, reset_option] ...\n\nDescription\n-----------\n\nThe RESET statement is used to clear the state of various server operations. You must have the RELOAD privilege to executeRESET.\n\nRESET acts as a stronger version of the FLUSH statement.\n\nThe different RESET options are:\n\n| Option                                           | Description                                                                                                                                                                                                                                                                                                                                                                                           |\n| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| SLAVE \\["connection_name"] \\[ALL]               | Deletes all relay logs from the slave and reset the replication position in the master binary log.                                                                                                                                                      |\n| MASTER | Deletes all old binary logs, makes the binary index file (--log-bin-index) empty and creates a new binary log file. This is useful when you want to reset the master to an initial state. If you want to just delete old, not used binary logs, you should use the PURGE BINARY LOGS command. |\n| QUERY CACHE                                      | Removes all queries from the query cache. See also FLUSH QUERY CACHE.                                                                                                                                                                                         |\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/reset', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/reset');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (539, 26, 'SET Statements', 'Description\n-----------\n\nset.md\n\nset-character-set.md\n\nset-global-sql_slave_skip_counter.md\n\nset-names.md\n\nset-password.md\n\nset-role.md\n\nset-sql_log_bin.md\n\nset-statement.md\n\nset-transaction.md\n\nset-variable.md\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/README', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/README');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (540, 26, 'SET PATH', 'Syntax\n------\n\nSET PATH ''db1 [, db2 [, ...]]''\n\nDescription\n-----------\n\nSets the list of schemas (databases) that MariaDB uses to search for stored routines to invoke. Such a search happens in the CALL statement and when stored function are used in expressions.\n\nThe value of the path is a string which contains comma-separated schema names. A schema name can be quoted with backticks (or double quotes, as appropriate). A special name CURRENT_SCHEMA means to look in the current schema. Spaces are ignored, unless they are part of a quoted schema name. A path cannot contain two equivalent schema names.\n\nThe following two commands invoke the same stored procedure:\n\n``sql\nCALL sys.optimizer_switch_on();\n`\nand\n`sql\nSET PATH ''sys'';\nCALL optimizer_switch_on();\n`\n\nA default value of the path is ''CURRENT_SCHEMA'' which provides the traditional behavior — stored routines must be in the current database.\n\nAlso the path is used to look up packages in package routine invocations. Assuming there is a package UTL_ENCODE in the sys schema, and it contains the function BASE64_DECODE(), one can write\n\n`sql\nSELECT sys.UTL_ENCODE.BASE64_DECODE(''data'');\n`\nor\n`sql\nSET PATH=''sys''; \nSELECT UTL_ENCODE.BASE64_DECODE(''data'');\n`\n\nNotes\n\n This functionality introduces the @@path system variable (session and global).\n The SET PATH statement sets the @@session.path variable. It is also possible to assign a new value to the @@path variable directory, using a statement like this: SET @@path=''sys''`.\n* Prepared statements, stored routines, and views remember the value of the path when they are created. The value of the path at the time of the execution does not apply.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-path', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-path');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (541, 26, 'SET SQL\\_LOG\\_BIN', 'Syntax\n------\n\nSET [SESSION] sql_log_bin = {0|1}\n\nDescription\n-----------\n\nSets the sql_log_bin system variable, which disables or enables binary logging for the current connection, if the client has the SUPER privilege. The statement is refused with an error if the client does not have that privilege.\n\nNote that setting sql_log_bin=1 has no effect if log_bin variable, which enables global binary logging, is not set.\n\nYou cannot set sql_log_bin as a global variable.\n\nYou can set sql_log_bin as a global variable. This is considered dangerous, though, as it can damage replication.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-sql_log_bin', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-sql_log_bin');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (542, 26, 'SET STATEMENT', 'Syntax\n------\n\nSET STATEMENT var1=value1 [, var2=value2, ...] \n  FOR <statement>\n\nDescription\n-----------\n\nSET STATEMENT var1=value1 FOR stmt\n\nis roughly equivalent to\n\n``sql\nSET @save_value=@@var1;\nSET SESSION var1=value1;\nstmt;\nSET SESSION var1=@save_value;\n``\n\nThe server parses the whole statement before executing it, so any variables set in this fashion that affect the parser may not have the expected effect. Examples include the charset variables, sql_mode=ansi_quotes, etc.\n\nExamples\n--------\n\nSET STATEMENT max_statement_time=1000 FOR SELECT ... ;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-statement', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-statement');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (543, 26, 'SET', 'Syntax\n------\n\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n      user_var_name = expr\n    | [GLOBAL | SESSION] system_var_name = expr\n    | [@@global. | @@session. | @@]system_var_name = expr\n\nDescription\n-----------\n\nThe SET statement assigns values to different types of variables that affect the operation of the server or your client.\n\nThe SET statement assigns values to different types of variables that affect the operation of the server or your client. Older versions of MySQL employed SET OPTION, but this syntax was deprecated in favor of SET without OPTION.\n\nChanging a system variable by using the SET statement does not make the change permanently. To do so, the change must be made in a configuration file.\n\nFor setting variables on a per-query basis, see SET STATEMENT.\n\nSee SHOW VARIABLES for documentation on viewing server system variables.\n\nSee Server System Variables for a list of all the system variables.\n\nGLOBAL / SESSION\n\nWhen setting a system variable, the scope can be specified as either GLOBAL or SESSION.\n\nA global variable change affects all new sessions. It does not affect any currently open sessions, including the one that made the change.\n\nA session variable change affects the current session only.\n\nIf the variable has a session value, not specifying either GLOBAL or SESSION will be the same as specifying SESSION. If the variable only has a global value, not specifying GLOBAL or SESSION will apply to the change to the global value.\n\nDEFAULT\n\nSetting a global variable to DEFAULT will restore it to the server default, and setting a session variable to DEFAULT will restore it to the current global value.\n\nExamples\n--------\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n  VARIABLE_NAME IN (''max_error_count'', ''skip_parallel_replication'', ''innodb_sync_spin_loops'');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 64           |\n| SKIP_PARALLEL_REPLICATION | OFF           | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (544, 26, 'About SHOW', 'Description\n-----------\n\nSHOW provides information about various aspects of MariaDB Server. A list of the various SHOW statements is here.\n\nThe general syntax is:\n\n``sql\nSHOW LIKE ''pattern'' | WHERE expr\n`\n\nThe LIKE and WHERE clauses make sense only for particular SHOW statements, though. See Extended SHOW for what SHOW statements benefit from using those clauses.\n\nIf the syntax for a given SHOW statement includes LIKE ''pattern'' , ''pattern'' is a\\\nstring that can contain the SQL % and _` wildcard characters. The pattern is useful for\\\nrestricting statement output to matching values.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/about-show', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/about-show');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (545, 26, 'Extended SHOW', 'Description\n-----------\n\nThe following SHOW statements can be extended using a WHERE clause and a LIKE clause to refine the results:\n\n SHOW CHARACTER SET\n SHOW COLLATION\n SHOW COLUMNS\n SHOW DATABASES\n SHOW FUNCTION STATUS\n SHOW INDEX\\\\\n SHOW OPEN TABLES\n SHOW PACKAGE STATUS\n SHOW PACKAGE BODY STATUS\n SHOW INDEX\n SHOW PROCEDURE STATUS\n SHOW STATUS\n SHOW TABLE STATUS\n SHOW TABLES\n SHOW TRIGGERS\n SHOW VARIABLES\n\nAs with a regular SELECT, the WHERE clause can be used for the specific columns returned, and the LIKE clause with the regular wildcards.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n| t1                   |\n| view1                |\n+----------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/extended-show', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/extended-show');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (546, 26, 'SHOW ANALYZE', 'Syntax\n------\n\nSHOW ANALYZE [FORMAT=JSON] FOR <connection_id>;\n\nDescription\n-----------\n\nSHOW ANALYZE allows one to retrieve ANALYZE-like output from a currently running statement. The statement\n\n``sql\nSHOW ANALYZE [FORMAT=JSON] FOR <connection_id>;\n`\n\nconnects to the query running in connection connection_id, gets information about the query plan it is executing, _also gets information about the runtime statistics of the execution so far_ and returns it in a format similar to ANALYZE [FORMAT=JSON] output.\n\nThis is similar to the SHOW EXPLAIN command, the difference being that SHOW ANALYZE also produces runtime statistics information.\n\nUse Case\n\nYou''re trying to troubleshoot a query that never finishes. Since it doesn''t finish, it is not possible to get ANALYZE output for it. With SHOW ANALYZE`, you can get the runtime statistics without waiting for the query to finish.\n\nExamples\n--------\n\nEXPLAIN format=json\nSELECT sum(orders.amount)\nFROM\n  customer JOIN orders ON customer.cust_id=orders.cust_id\nWHERE\n  customer.status=''GOLD'';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-analyze', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-analyze');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (547, 26, 'SHOW AUTHORS', 'Syntax\n------\n\nSHOW AUTHORS\n\nDescription\n-----------\n\nThe SHOW AUTHORS statement displays information about the people who work on MariaDB. For each author, it displays Name, Location, and Comment values. All columns are encoded as latin1.\n\nThese include:\n\n First the active people in MariaDB are listed.\n Then the active people in MySQL.\n Last the people that have contributed to MariaDB/MySQL in the past.\n\nThe order is somewhat related to importance of the contribution given to the MariaDB project, but this is not 100% accurate. There is still room for improvement and debate...\n\nExamples\n--------\n\nSHOW AUTHORS\\G\n*********************** 1. row *********************\n    Name: Michael (Monty) Widenius\nLocation: Tusby, Finland\n Comment: Lead developer and main author\n********************* 2. row *********************\n    Name: Sergei Golubchik\nLocation: Kerpen, Germany\n Comment: Architect, Full-text search, precision math, plugin framework, merges etc\n********************* 3. row *********************\n    Name: Igor Babaev\nLocation: Bellevue, USA\n Comment: Optimizer, keycache, core work\n********************* 4. row *********************\n    Name: Sergey Petrunia\nLocation: St. Petersburg, Russia\n Comment: Optimizer\n********************* 5. row *********************\n    Name: Oleksandr Byelkin\nLocation: Lugansk, Ukraine\n Comment: Query Cache (4.0), Subqueries (4.1), Views (5.0)\n********************* 6. row *********************\n    Name: Timour Katchaounov\nLocation: Sofia , Bulgaria\n Comment: Optimizer\n********************* 7. row *********************\n    Name: Kristian Nielsen\nLocation: Copenhagen, Denmark\n Comment: Replication, Async client prototocol, General buildbot stuff\n********************* 8. row *********************\n    Name: Alexander (Bar) Barkov\nLocation: Izhevsk, Russia\n Comment: Unicode and character sets\n********************* 9. row *********************\n    Name: Alexey Botchkov (Holyfoot)\nLocation: Izhevsk, Russia\n Comment: GIS extensions, embedded server, precision math\n********************* 10. row *********************\n    Name: Daniel Bartholomew\nLocation: Raleigh, USA\n Comment: MariaDB documentation, Buildbot, releases\n********************* 11. row *********************\n    Name: Colin Charles\nLocation: Selangor, Malesia\n Comment: MariaDB documentation, talks at a LOT of conferences\n********************* 12. row *********************\n    Name: Sergey Vojtovich\nLocation: Izhevsk, Russia\n Comment: initial implementation of plugin architecture, maintained native storage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache\n********************* 13. row *********************\n    Name: Vladislav Vaintroub\nLocation: Mannheim, Germany\n Comment: MariaDB Java connector, new thread pool, Windows optimizations\n********************* 14. row *********************\n    Name: Elena Stepanova\nLocation: Sankt Petersburg, Russia\n Comment: QA, test cases\n********************* 15. row *********************\n    Name: Georg Richter\nLocation: Heidelberg, Germany\n Comment: New LGPL C connector, PHP connector\n********************* 16. row *********************\n    Name: Jan Lindström\nLocation: Ylämylly, Finland\n Comment: Working on InnoDB\n********************* 17. row *********************\n    Name: Lixun Peng\nLocation: Hangzhou, China\n Comment: Multi Source replication\n********************* 18. row *********************\n    Name: Olivier Bertrand\nLocation: Paris, France\n Comment: CONNECT storage engine\n********************* 19. row *********************\n    Name: Kentoku Shiba\nLocation: Tokyo, Japan\n Comment: Spider storage engine, metadata_lock_info Information schema\n********************* 20. row *********************\n    Name: Percona\nLocation: CA, USA\n Comment: XtraDB, microslow patches, extensions to slow log\n********************* 21. row *********************\n    Name: Vicentiu Ciorbaru\nLocation: Bucharest, Romania\n Comment: Roles\n********************* 22. row *********************\n    Name: Sudheera Palihakkara\nLocation: \n Comment: PCRE Regular Expressions\n********************* 23. row *********************\n    Name: Pavel Ivanov\nLocation: USA\n Comment: Some patches and bug fixes\n********************* 24. row *********************\n    Name: Konstantin Osipov\nLocation: Moscow, Russia\n Comment: Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0)\n********************* 25. row *********************\n    Name: Ian Gilfillan\nLocation: South Africa\n Comment: MariaDB documentation\n********************* 26. row *********************\n    Name: Federico Razolli\nLocation: Italy\n Comment: MariaDB documentation Italian translation\n********************* 27. row *********************\n    Name: Guilhem Bichot\nLocation: Bordeaux, France\n Comment: Replication (since 4.0)\n********************* 28. row *********************\n    Name: Andrei Elkin\nLocation: Espoo, Finland\n Comment: Replication\n********************* 29. row *********************\n    Name: Dmitri Lenev\nLocation: Moscow, Russia\n Comment: Time zones support (4.1), Triggers (5.0)\n********************* 30. row *********************\n    Name: Marc Alff\nLocation: Denver, CO, USA\n Comment: Signal, Resignal, Performance schema\n********************* 31. row *********************\n    Name: Mikael Ronström\nLocation: Stockholm, Sweden\n Comment: NDB Cluster, Partitioning, online alter table\n********************* 32. row *********************\n    Name: Ingo Strüwing\nLocation: Berlin, Germany\n Comment: Bug fixing in MyISAM, Merge tables etc\n********************* 33. row ************************\n    Name: Marko Mäkelä\nLocation: Helsinki, Finland\n Comment: InnoDB core developer\n...\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-authors', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-authors');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (548, 26, 'SHOW BINARY LOGS', 'Syntax\n------\n\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nDescription\n-----------\n\nLists the binary log files on the server. This statement is used as part of the procedure described in PURGE BINARY LOGS, that shows how to determine which logs can be purged.\n\nThis statement requires the BINLOG MONITOR privilege.\n\nThis statement requires the SUPER privilege and the REPLICATION_CLIENT privilege.\n\nExamples\n--------\n\nSHOW BINARY LOGS;\n+--------------------+-----------+\n| Log_name           | File_size |\n+--------------------+-----------+\n| mariadb-bin.000001 |     19039 |\n| mariadb-bin.000002 |    717389 |\n| mariadb-bin.000003 |       300 |\n| mariadb-bin.000004 |       333 |\n| mariadb-bin.000005 |       899 |\n| mariadb-bin.000006 |       125 |\n| mariadb-bin.000007 |     18907 |\n| mariadb-bin.000008 |     19530 |\n| mariadb-bin.000009 |       151 |\n| mariadb-bin.000010 |       151 |\n| mariadb-bin.000011 |       125 |\n| mariadb-bin.000012 |       151 |\n| mariadb-bin.000013 |       151 |\n| mariadb-bin.000014 |       125 |\n| mariadb-bin.000015 |       151 |\n| mariadb-bin.000016 |       314 |\n+--------------------+-----------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binary-logs', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binary-logs');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (549, 26, 'SHOW BINLOG EVENTS', 'Syntax\n------\n\nSHOW BINLOG EVENTS\n   [IN ''log_name''] [FROM pos] [LIMIT [offset,] row_count]\n\nDescription\n-----------\n\nShows the events in the binary log. If you do not specify log_name, the first binary log is displayed.\n\nThis statement requires the BINLOG MONITOR privilege.\n\nThis statement requires the REPLICATION SLAVE privilege.\n\nExamples\n--------\n\nSHOW BINLOG EVENTS IN ''mysql_sandbox10019-bin.000002'';\n+-------------------------------+-----+-------------------+-----------+-------------+------------------------------------------------+\n| Log_name                      | Pos | Event_type        | Server_id | End_log_pos | Info                                           |\n+-------------------------------+-----+-------------------+-----------+-------------+------------------------------------------------+\n| mysql_sandbox10019-bin.000002 |   4 | Format_desc       |         1 |         248 | Server ver: 10.0.19-MariaDB-log, Binlog ver: 4 |\n| mysql_sandbox10019-bin.000002 | 248 | Gtid_list         |         1 |         273 | []                                             |\n| mysql_sandbox10019-bin.000002 | 273 | Binlog_checkpoint |         1 |         325 | mysql_sandbox10019-bin.000002                  |\n| mysql_sandbox10019-bin.000002 | 325 | Gtid              |         1 |         363 | GTID 0-1-1                                     |\n| mysql_sandbox10019-bin.000002 | 363 | Query             |         1 |         446 | CREATE DATABASE blog                           |\n| mysql_sandbox10019-bin.000002 | 446 | Gtid              |         1 |         484 | GTID 0-1-2                                     |\n| mysql_sandbox10019-bin.000002 | 484 | Query             |         1 |         571 | use blog; CREATE TABLE bb (id INT)           |\n+-------------------------------+-----+-------------------+-----------+-------------+------------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binlog-events', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binlog-events');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (550, 26, 'SHOW MASTER STATUS', 'Syntax\n------\n\nSHOW [MASTER | BINLOG] STATUS\n\nDescription\n-----------\n\nProvides status information about the binary log files of the master.\n\nThis statement requires the BINLOG MONITOR privilege.\n\nThis statement requires the SUPER privilege and the REPLICATION_CLIENT privilege.\n\nThe following improved functionality is available from MariaDB 12.3.\n\nTo see information about the current GTIDs in the binary log, use the gtid_binlog_pos variable. It is enabled by default, and helps find the current state of the master server. (Previously, this required two statements, SHOW MASTER STATUS and SELECT @@global.gtid_binlog_pos.)\n\nExamples\n--------\n\nSHOW BINLOG STATUS;\n+--------------------+----------+--------------+------------------+\n| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+--------------------+----------+--------------+------------------+\n| mariadb-bin.000016 |      475 |              |                  |\n+--------------------+----------+--------------+------------------+\nSELECT @@global.gtid_binlog_pos;\n+--------------------------+\n| @@global.gtid_binlog_pos |\n+--------------------------+\n| 0-1-2                    |\n+--------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binlog-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binlog-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (551, 26, 'SHOW CHARACTER SET', 'Syntax\n------\n\nSHOW CHARACTER SET\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW CHARACTER SET statement shows all available character sets. The LIKE clause, if present on its own, indicates which character set names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema CHARACTER_SETS table.\n\nSee Setting Character Sets and Collations for details on specifying the character set at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW CHARACTER SET LIKE ''latin%'';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description                 | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\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+---------+-----------------------------+-------------------+--------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-character-set', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-character-set');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (552, 26, 'SHOW CLIENT\\_STATISTICS', 'Syntax\n------\n\nSHOW CLIENT_STATISTICS\n\nDescription\n-----------\n\nThe SHOW CLIENT_STATISTICS statement has effectively been replaced by the generic SHOW TABLE STATISTICS statement. The information_schema.CLIENT_STATISTICS table holds statistics about client connections.\n\nThe SHOW CLIENT_STATISTICS statement is part of the User Statistics feature. The information_schema.CLIENT_STATISTICS table holds statistics about client connections.\n\nThe userstat system variable must be set to 1 to activate this feature. See the User Statistics and information_schema.CLIENT_STATISTICS articles for more information.\n\nExamples\n--------\n\nSHOW CLIENT_STATISTICS\\G\n************************ 1. row ************************\n                Client: localhost\n     Total_connections: 35\nConcurrent_connections: 0\n        Connected_time: 708\n             Busy_time: 2.5557979999999985\n              Cpu_time: 0.04123740000000002\n        Bytes_received: 3883\n            Bytes_sent: 21595\n  Binlog_bytes_written: 0\n             Rows_read: 18\n             Rows_sent: 115\n          Rows_deleted: 0\n         Rows_inserted: 0\n          Rows_updated: 0\n       Select_commands: 70\n       Update_commands: 0\n        Other_commands: 0\n   Commit_transactions: 1\n Rollback_transactions: 0\n    Denied_connections: 0\n      Lost_connections: 0\n         Access_denied: 0\n         Empty_queries: 35\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-client-statistics', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-client-statistics');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (553, 26, 'SHOW COLLATION', 'Syntax\n------\n\nSHOW COLLATION\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nThe output from SHOW COLLATION includes all available collations. The LIKE clause, if present on its own, indicates which collation names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nSimilar information, including some extra information, can be queried from the Information Schema COLLATIONS table.\n\nNo similar information or extra information can be queried from the Information Schema COLLATIONS table.\n\nSee Setting Character Sets and Collations for details on specifying the collation at the server, database, table and column levels.\n\nThe pad_attribute column (not shown in the examples below) has a value of NO PAD or PAD SPACE. This attribute affects whether trailing spaces are significant in string comparisons. See the INFORMATION_SCHEMA.COLLATIONS table description for more information.\n\n``sql\nSHOW COLLATION LIKE ''utf8mb4_bin''; \n+-------------+---------+------+---------+----------+---------+---------------+ \n| Collation   | Charset | Id   | Default | Compiled | Sortlen | Pad_attribute | \n+-------------+---------+------+---------+----------+---------+---------------+ \n| utf8mb4_bin | utf8mb4 | 46   |         | Yes      | 1       | PAD SPACE     | \n+-------------+---------+------+---------+----------+---------+---------------+\n`\n\nThe pad_attribute` column is not available.\n\nExamples\n--------\n\nSHOW COLLATION LIKE ''latin1%'';\n+-------------------------+---------+------+---------+----------+---------+\n| Collation               | Charset | Id   | Default | Compiled | Sortlen |\n+-------------------------+---------+------+---------+----------+---------+\n| latin1_german1_ci       | latin1  |    5 |         | Yes      |       1 |\n| latin1_swedish_ci       | latin1  |    8 | Yes     | Yes      |       1 |\n| latin1_danish_ci        | latin1  |   15 |         | Yes      |       1 |\n| latin1_german2_ci       | latin1  |   31 |         | Yes      |       2 |\n| latin1_bin              | latin1  |   47 |         | Yes      |       1 |\n| latin1_general_ci       | latin1  |   48 |         | Yes      |       1 |\n| latin1_general_cs       | latin1  |   49 |         | Yes      |       1 |\n| latin1_spanish_ci       | latin1  |   94 |         | Yes      |       1 |\n| latin1_swedish_nopad_ci | latin1  | 1032 |         | Yes      |       1 |\n| latin1_nopad_bin        | latin1  | 1071 |         | Yes      |       1 |\n+-------------------------+---------+------+---------+----------+---------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-collation', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-collation');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (554, 26, 'SHOW COLUMNS', 'Syntax\n------\n\nSHOW [FULL] {COLUMNS | FIELDS} FROM tbl_name [FROM db_name]\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW COLUMNS displays information about the columns in a given table. It also works for views. The LIKE clause, if present on its own, indicates which column names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nIf the data types differ from what you expect them to be based on aCREATE TABLE statement, note that MariaDB sometimes changes data types when you create or alter a table. The conditions under which this occurs are described in the Silent Column Changes article.\n\nThe FULL keyword causes the output to include the column collation and comments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to thetbl_name FROM db_name syntax. In other words, these two statements are equivalent:\n\n``sql\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n`\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for non-binary string columns, or NULL for other columns. This value is displayed only if you use the FULL keyword.\n\nThe Null field contains YES if NULL values can be stored in the column, NO if not.\n\nThe Key field indicates whether the column is indexed:\n\n If Key is empty, the column either is not indexed or is indexed only as a secondary column in a multiple-column, non-unique index.\n If Key is PRI, the column is a PRIMARY KEY or is one of the columns in a multiple-column PRIMARY KEY.\n If Key is UNI, the column is the first column of a unique-valued index that cannot contain NULL values.\n If Key is MUL, multiple occurrences of a given value are allowed within the column. The column is the first column of a non-unique index or a unique-valued index that can contain NULL values.\n\nIf more than one of the Key values applies to a given column of a table, Key displays the one with the highest priority, in the order PRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values and there is noPRIMARY KEY in the table. A UNIQUE index may display as MUL if several columns form a compositeUNIQUE index; although the combination of the columns is unique, each column can still hold multiple occurrences of a given value.\n\nThe Default field indicates the default value that is assigned to the column.\n\nThe Extra field contains any additional information that is available about a given column.\n\n| Value                        | Description                                                                          |\n| ---------------------------- | ------------------------------------------------------------------------------------ |\n| AUTO_INCREMENT              | The column was created with the AUTO_INCREMENT keyword.                             |\n| PERSISTENT                   | The column was created with the PERSISTENT keyword.                                  |\n| VIRTUAL                      | The column was created with the VIRTUAL keyword.                                     |\n| on update CURRENT_TIMESTAMP | The column is a TIMESTAMP column that is automatically updated on INSERT and UPDATE. |\n\nPrivileges indicates the privileges you have for the column. This value is displayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed only if you use the FULL keyword.\n\nSHOW FIELDS is a synonym forSHOW COLUMNS. Also DESCRIBE and EXPLAIN can be used as shortcuts.\n\nYou can also list a table''s columns with:\n\n`\nmariadb-show db_name tbl_name\n`\n\nSee the mariadb-show command for more details.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS`. The information_schema.COLUMNS table provides similar, but more complete, information.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements also provide information about tables.\n\nExamples\n--------\n\nSHOW COLUMNS FROM city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | NO   |     |         |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | NO   |     | 0       |                |\n+------------+----------+------+-----+---------+----------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-columns', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-columns');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (555, 26, 'SHOW CONTRIBUTORS', 'Syntax\n------\n\nSHOW CONTRIBUTORS\n\nDescription\n-----------\n\nThe SHOW CONTRIBUTORS statement displays information about the companies and people who financially contribute to MariaDB. For each contributor, it displays Name, Location, and Comment values. All columns are encoded as latin1.\n\nIt displays all members and sponsors of the MariaDB Foundation as well as other financial contributors.\n\nExamples\n--------\n\nSHOW CONTRIBUTORS;\n+---------------------+-------------------------------+-------------------------------------------------------------+\n| Name                | Location                      | Comment                                                     |\n+---------------------+-------------------------------+-------------------------------------------------------------+\n| Alibaba Cloud       | https://www.alibabacloud.com/ | Platinum Sponsor of the MariaDB Foundation                  |\n| Tencent Cloud       | https://cloud.tencent.com     | Platinum Sponsor of the MariaDB Foundation                  |\n| Microsoft           | https://microsoft.com/        | Platinum Sponsor of the MariaDB Foundation                  |\n| MariaDB Corporation | https://mariadb.com           | Founding member, Platinum Sponsor of the MariaDB Foundation |\n| ServiceNow          | https://servicenow.com        | Platinum Sponsor of the MariaDB Foundation                  |\n| Intel               | https://www.intel.com         | Platinum Sponsor of the MariaDB Foundation                  |\n| SIT                 | https://sit.org               | Platinum Sponsor of the MariaDB Foundation                  |\n| Visma               | https://visma.com             | Gold Sponsor of the MariaDB Foundation                      |\n| DBS                 | https://dbs.com               | Gold Sponsor of the MariaDB Foundation                      |\n| IBM                 | https://www.ibm.com           | Gold Sponsor of the MariaDB Foundation                      |\n| Automattic          | https://automattic.com        | Silver Sponsor of the MariaDB Foundation                    |\n| Percona             | https://www.percona.com/      | Sponsor of the MariaDB Foundation                           |\n| Galera Cluster      | https://galeracluster.com     | Sponsor of the MariaDB Foundation                           |\n| Google              | USA                           | Sponsoring encryption, parallel replication and GTID        |\n| Facebook            | USA                           | Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc        |\n| Ronald Bradford     | Brisbane, Australia           | EFF contribution for UC2006 Auction                         |\n| Sheeri Kritzer      | Boston, Mass. USA             | EFF contribution for UC2006 Auction                         |\n| Mark Shuttleworth   | London, UK.                   | EFF contribution for UC2006 Auction                         |\n+---------------------+-------------------------------+-------------------------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-contributors', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-contributors');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (556, 26, 'SHOW CREATE DATABASE', 'Syntax\n------\n\nSHOW CREATE {DATABASE | SCHEMA} db_name\n\nDescription\n-----------\n\nShows the CREATE DATABASE statement that creates the given database. SHOW CREATE SCHEMA is a synonym for SHOW CREATE DATABASE. SHOW CREATE DATABASE quotes database names according to the value of the sql_quote_show_create server system variable.\n\nExamples\n--------\n\nSHOW CREATE DATABASE test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database                                                 |\n+----------+-----------------------------------------------------------------+\n| test     | CREATE DATABASE test /!40100 DEFAULT CHARACTER SET latin1 / |\n+----------+-----------------------------------------------------------------+\n\nSHOW CREATE SCHEMA test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database                                                 |\n+----------+-----------------------------------------------------------------+\n| test     | CREATE DATABASE test /!40100 DEFAULT CHARACTER SET latin1 / |\n+----------+-----------------------------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-database', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-database');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (557, 26, 'SHOW CREATE EVENT', 'Syntax\n------\n\nSHOW CREATE EVENT event_name\n\nDescription\n-----------\n\nThis statement displays the CREATE EVENT statement that creates a given event, as well as the SQL_MODE that was used when the trigger was created, and the character set used by the connection. To find out which events are present, use SHOW EVENTS.\n\nSHOW CREATE EVENT quotes identifiers according to the value of the sql_quote_show_create system variable.\n\nSHOW CREATE EVENT quotes identifiers according to the value of the sql_quote_show_create system variable. Note, however, that the output of this statement is unreliably affected by the sql_quote_show_create system variable.\n\nThe information_schema.EVENTS table provides similar, but more complete, information.\n\nExamples\n--------\n\nSHOW CREATE EVENT test.e_daily\\G\n************************ 1. row ***********************\n               Event: e_daily\n            sql_mode: \n           time_zone: SYSTEM\n        Create Event: CREATE EVENT e_daily\n                        ON SCHEDULE EVERY 1 DAY\n                        STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n                        ON COMPLETION NOT PRESERVE\n                        ENABLE\n                        COMMENT ''Saves total number of sessions then\n                                clears the table each day''\n                        DO BEGIN\n                          INSERT INTO site_activity.totals (time, total)\n                            SELECT CURRENT_TIMESTAMP, COUNT() \n                            FROM site_activity.sessions;\n                          DELETE FROM site_activity.sessions;\n                        END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-event', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-event');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (558, 26, 'SHOW CREATE FUNCTION', 'Syntax\n------\n\nSHOW CREATE FUNCTION func_name\n\nDescription\n-----------\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored functions.\n\nSHOW CREATE FUNCTION quotes identifiers, according to the value of the sql_quote_show_create system variable.\n\nSHOW CREATE FUNCTION quotes identifiers, according to the value of the sql_quote_show_create system variable. However, the output of this statement is unreliably affected by the sql_quote_show_create system variable.\n\nExamples\n--------\n\nSHOW CREATE FUNCTION VatCents\\G\n************************ 1. row ***********************\n            Function: VatCents\n            sql_mode: \n     Create Function: CREATE DEFINER=root@localhost FUNCTION VatCents(price DECIMAL(10,2)) RETURNS int(11)\n    DETERMINISTIC\nBEGIN\n DECLARE x INT;\n SET x = price  114;\n RETURN x;\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-function', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-function');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (559, 26, 'SHOW CREATE PACKAGE BODY', 'Syntax\n------\n\nSHOW CREATE PACKAGE BODY  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE BODY statement shows the CREATE PACKAGE BODY statement that creates the given package body (that is, the implementation of the package).\n\nThe SHOW CREATE PACKAGE BODY statement shows the CREATE PACKAGE BODY statement that creates the given package body (that is, the implementation of the package). CREATE PACKAGE BODY can be used when Oracle SQL_MODE is set.\n\nSHOW CREATE PACKAGE BODY quotes identifiers according to the value of the sql_quote_show_create system variable.\n\nExamples\n--------\n\nSHOW CREATE PACKAGE BODY employee_tools\\G\n************************ 1. row ************************\n        Package body: employee_tools\n            sql_mode: PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package Body: CREATE DEFINER="root"@"localhost" PACKAGE BODY "employee_tools" AS\n  \n  stdRaiseAmount DECIMAL(10,2):=500;\n  \n  PROCEDURE log (eid INT, ecmnt TEXT) AS\n  BEGIN\n    INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n  END;\n  \n  PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n    eid INT;\n  BEGIN\n    INSERT INTO employee (name, salary) VALUES (ename, esalary);\n    eid:= last_insert_id();\n    log(eid, ''hire '' || ename);\n  END;\n\n  FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n    nSalary DECIMAL(10,2);\n  BEGIN\n    SELECT salary INTO nSalary FROM employee WHERE id=eid;\n    log(eid, ''getSalary id='' || eid || '' salary='' || nSalary);\n    RETURN nSalary;\n  END;\n\n  PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n  BEGIN\n    UPDATE employee SET salary=salary+amount WHERE id=eid;\n    log(eid, ''raiseSalary id='' || eid || '' amount='' || amount);\n  END;\n\n  PROCEDURE raiseSalaryStd(eid INT) AS\n  BEGIN\n    raiseSalary(eid, stdRaiseAmount);\n    log(eid, ''raiseSalaryStd id='' || eid);\n  END;\n\nBEGIN  \n  log(0, ''Session '' || connection_id() || '' '' || current_user || '' started'');\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-package-body', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-package-body');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (560, 26, 'SHOW CREATE PACKAGE', 'Syntax\n------\n\nSHOW CREATE PACKAGE  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE statement can be used when Oracle SQL_MODE is set. It shows the CREATE statement that creates the given package specification.\n\nSHOW CREATE PACKAGE quotes identifiers according to the value of the sql_quote_show_create system variable.\n\nExamples\n--------\n\nSHOW CREATE PACKAGE employee_tools\\G\n************************ 1. row ************************\n             Package: employee_tools\n            sql_mode: PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n      Create Package: CREATE DEFINER="root"@"localhost" PACKAGE "employee_tools" AS\n  FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n  PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n  PROCEDURE raiseSalaryStd(eid INT);\n  PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-package', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-package');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (561, 26, 'SHOW CREATE PROCEDURE', 'Syntax\n------\n\nSHOW CREATE PROCEDURE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns the exact string that can be used to re-create the named stored procedure, as well as the SQL_MODE that was used when the trigger has been created and the character set used by the connection.. A similar statement, SHOW CREATE FUNCTION, displays information about stored functions.\n\nBoth statements require that:\n\n you are the owner of the routine;\n you have the SHOW CREATE ROUTINE privilege (from MariaDB 11.3.0); or\n you have the SELECT privilege on the mysql.proc table.\n\nWhen none of the above statements are true, the statements display NULL for the Create Procedure or Create Function field.\n\nUsers with SELECT privileges on mysql.proc or USAGE privileges on . can view the text of routines, even when they do not have privileges for the function or procedure itself.\n\nSHOW CREATE PROCEDURE quotes identifiers, according to the value of the sql_quote_show_create system variable.\n\nSHOW CREATE PROCEDURE quotes identifiers, according to the value of the sql_quote_show_create system variable. The output of this statement is unreliably affected by the sql_quote_show_create system variable.\n\nExamples\n--------\n\nSHOW CREATE PROCEDURE test.simpleproc\\G\n*********************** 1. row ***********************\n           Procedure: simpleproc\n            sql_mode: \n    Create Procedure: CREATE PROCEDURE simpleproc(OUT param1 INT)\n                      BEGIN\n                      SELECT COUNT() INTO param1 FROM t;\n                      END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n\nSHOW CREATE FUNCTION test.hello\\G\n************************ 1. row ************************\n            Function: hello\n            sql_mode:\n     Create Function: CREATE FUNCTION hello(s CHAR(20))\n                      RETURNS CHAR(50)\n                      RETURN CONCAT(''Hello, '',s,''!'')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-procedure', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-procedure');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (562, 26, 'SHOW CREATE SEQUENCE', 'Syntax\n------\n\nSHOW CREATE SEQUENCE sequence_name;\n\nDescription\n-----------\n\nShows the CREATE SEQUENCE statement that creates the given sequence. The statement requires the SELECT privilege for the table.\n\nSHOW CREATE SEQUENCE quotes identifiers according to the value of the sql_quote_show_create system variable.\n\nExamples\n--------\n\nCREATE SEQUENCE s1 START WITH 50;\nSHOW CREATE SEQUENCE s1\\G;\n************************ 1. row ************************\n       Table: s1\nCreate Table: CREATE SEQUENCE s1 start with 50 minvalue 1 maxvalue 9223372036854775806 \n  increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-sequence', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-sequence');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (563, 26, 'SHOW CREATE SERVER', 'Description\n-----------\n\nSyntax\n\n``sql\nSHOW CREATE SERVER server_name\n`\n\nDescription\n\nShows the CREATE SERVER statement that created the given server definition.\n\nExample\n\n`sql\nSHOW CREATE SERVER srv1\\G\n************************ 1. row ************************\n       Server: srv1\nCreate Server: CREATE SERVER srv1 FOREIGN DATA WRAPPER mysql \n  OPTIONS (HOST ''172.30.0.58'', DATABASE ''db1'', USER ''maxscale'', PASSWORD ''password'');\n`\n\nThe SHOW CREATE SERVER` statement is not available.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-server', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-server');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (564, 26, 'SHOW CREATE TABLE', 'Syntax\n------\n\nSHOW CREATE TABLE tbl_name\n\nDescription\n-----------\n\nShows the CREATE TABLE statement that creates the given table. The statement requires the SELECT privilege for the table. This statement also works with views and SEQUENCE.\n\nSHOW CREATE TABLE quotes table and column names according to the value of the sql_quote_show_create server system variable.\n\nCertain SQL_MODE values can result in parts of the original CREATE statement not being included in the output. MariaDB-specific table options, column options, and index options are not included in the output of this statement if the NO_TABLE_OPTIONS, NO_FIELD_OPTIONS and NO_KEY_OPTIONS SQL_MODE flags are used. All MariaDB-specific table attributes are also not shown when a non-MariaDB/MySQL emulation mode is used, which includes ANSI, DB2, POSTGRESQL, MSSQL, MAXDB or ORACLE.\n\nInvalid table options, column options and index options are normally commented out (note, that it is possible to create a table with invalid options, by altering a table of a different engine, where these options were valid). To have them uncommented, enable the IGNORE_BAD_TABLE_OPTIONS SQL_MODE. Remember that replaying a CREATE TABLE statement with uncommented invalid options will fail with an error, unless the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is in effect.\n\nNote that SHOW CREATE TABLE is not meant to provide metadata about a table. It provides information about how the table was declared, but the real table structure could differ a bit. For example, if an index has been declared as HASH, the CREATE TABLE statement returned by SHOW CREATE TABLE will declare that index as HASH; however, it is possible that the index is in fact a BTREE, because the storage engine does not support HASH.\n\nMariaDB permits TEXT and BLOB data types to be assigned a DEFAULT value. As a result, SHOW CREATE TABLE will append a DEFAULT NULL to nullable TEXT or BLOB fields if no specific default is provided.\n\nNumbers are quoted in the DEFAULT clause in SHOW CREATE statement.\n\nNumbers are not quoted in the DEFAULT clause in SHOW CREATE statement.\n\nIndex Order\n\nIndexes are sorted and displayed in the following order, which may differ from the order of the CREATE TABLE statement.\n\n PRIMARY KEY\n UNIQUE keys where all column are NOT NULL\n UNIQUE keys that don''t contain partial segments\n Other UNIQUE keys\n LONG UNIQUE keys\n Normal keys\n Fulltext keys\n\nSee sql/sql_table.cc for details.\n\nExamples\n--------\n\nSHOW CREATE TABLE t\\G\n*********************** 1. row ************************\n       Table: t\nCreate Table: CREATE TABLE t (\n  id int(11) NOT NULL AUTO_INCREMENT,\n  s char(60) DEFAULT NULL,\n  PRIMARY KEY (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-table', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-table');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (565, 26, 'SHOW CREATE TRIGGER', 'Syntax\n------\n\nSHOW CREATE TRIGGER trigger_name\n\nDescription\n-----------\n\nThis statement shows a CREATE TRIGGER statement that creates the given trigger, as well as the SQL_MODE that was used when the trigger has been created and the character set used by the connection.\n\nThe TRIGGER privilege is required on the table the trigger is defined for to execute this statement.\n\nSHOW CREATE TRIGGER quotes identifiers, according to the value of the sql_quote_show_create system variable.\n\nSHOW CREATE TRIGGER quotes identifiers, according to the value of the sql_quote_show_create system variable. However, the output of this statement is unreliably affected by the sql_quote_show_create system variable.\n\nExamples\n--------\n\nSHOW CREATE TRIGGER example\\G\n************************ 1. row ***********************\n               Trigger: example\n              sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,STRICT_ALL_TABLES\n,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_\nENGINE_SUBSTITUTION\nSQL Original Statement: CREATE DEFINER=root@localhost TRIGGER example BEFORE\n INSERT ON t FOR EACH ROW\nBEGIN\n        SET NEW.c = NEW.c  2;\nEND\n  character_set_client: cp850\n  collation_connection: cp850_general_ci\n  Database Collation: utf8_general_ci\n  Created: 2016-09-29 13:53:34.35\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-trigger', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-trigger');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (566, 26, 'SHOW CREATE USER', 'Syntax\n------\n\nSHOW CREATE USER [user-name]\n\nDescription\n-----------\n\nShows the CREATE USER statement that creates the given user. The statement requires the SELECT privilege for the mysql database, except for the current user. The CREATE USER statement for the current user is shown where no user is specified.\n\nSHOW CREATE USER quotes identifiers according to the value of the sql_quote_show_create system variable.\n\nExamples\n--------\n\nCREATE USER foo4@test require cipher ''text'' \n  issuer ''foo_issuer'' subject ''foo_subject'';\n\nSHOW CREATE USER foo4@test\\G\n************************ 1. row ************************\nCREATE USER ''foo4''@''test'' \n  REQUIRE ISSUER ''foo_issuer'' \n  SUBJECT ''foo_subject'' \n  CIPHER ''text''\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-user', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-user');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (567, 26, 'SHOW CREATE VIEW', 'Syntax\n------\n\nSHOW CREATE VIEW [view-name]\n\nDescription\n-----------\n\nThis statement shows a CREATE VIEW statement that creates the given view, as well as the character set used by the connection when the view was created. This statement also works with views.\n\nSHOW CREATE VIEW quotes table, column and stored function names according to the value of the sql_quote_show_create server system variable.\n\nExamples\n--------\n\nSHOW CREATE VIEW example\\G\n************************ 1. row ************************\n                View: example\n         Create View: CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL\nSECURITY DEFINER VIEW example AS (select t.id AS id,t.s AS s from\nt)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-view', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-view');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (568, 26, 'SHOW DATABASES', 'Syntax\n------\n\nSHOW {DATABASES | SCHEMAS}\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW DATABASES lists the databases on the MariaDB server host.SHOW SCHEMAS is a synonym forSHOW DATABASES. The LIKE clause, if present on its own, indicates which database names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nYou see only those databases for which you have some kind of privilege, unless you have the global SHOW DATABASES privilege. You can also get this list using the mariadb-show command.\n\nIf the server was started with the --skip-show-database option, you cannot use this statement at all unless you have the SHOW DATABASES privilege.\n\nThe list of results returned by SHOW DATABASES is based on directories in the data directory, which is how MariaDB implements databases. It''s possible that output includes directories that do not correspond to actual databases.\n\nThe Information Schema SCHEMATA table also contains database information.\n\nExamples\n--------\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| test               |\n+--------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-databases', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-databases');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (569, 26, 'SHOW ENGINE INNODB STATUS', 'Description\n-----------\n\nSyntax\n\n``sql\nSHOW ENGINE INNODB STATUS\n`\n\nSHOW ENGINE INNODB STATUS is a specific form of the SHOW ENGINE statement that displays the InnoDB Monitor output, which is extensive InnoDB information which can be useful in diagnosing problems.\n\nThe following sections are displayed\n\n Status: Shows the timestamp, monitor name and the number of seconds, or the elapsed time between the current time and the time the InnoDB Monitor output was last displayed. The per-second averages are based upon this time.\n BACKGROUND THREAD: srv_master_thread lines show work performed by the main background thread.\n SEMAPHORES: Threads waiting for a semaphore and stats on how the number of times threads have needed a spin or a wait on a mutex or rw-lock semaphore. If this number of threads is large, there may be I/O or contention issues. Reducing the size of the innodb_thread_concurrency system variable may help if contention is related to thread scheduling. Spin rounds per wait shows the number of spinlock rounds per OS wait for a mutex.\n LATEST FOREIGN KEY ERROR: Only shown if there has been a foreign key constraint error, it displays the failed statement and information about the constraint and the related tables.\n LATEST DETECTED DEADLOCK: Only shown if there has been a deadlock, it displays the transactions involved in the deadlock and the statements being executed, held and required locked and the transaction rolled back to.\n TRANSACTIONS: The output of this section can help identify lock contention, as well as reasons for the deadlocks.\n FILE I/O: InnoDB thread information as well as pending I/O operations and I/O performance statistics.\n INSERT BUFFER AND ADAPTIVE HASH INDEX: InnoDB insert buffer (old name for the change buffer) and adaptive hash index status information, including the number of each type of operation performed, and adaptive hash index performance.\n LOG: InnoDB log information, including current log sequence number, how far the log has been flushed to disk, the position at which InnoDB last took a checkpoint, pending writes and write performance statistics.\n BUFFER POOL AND MEMORY: Information on buffer pool pages read and written, which allows you to see the number of data file I/O operations performed by your queries. See InnoDB Buffer Pool for more. Similar information is also available from the INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS table.\n* ROW OPERATIONS:Information about the main thread, including the number and performance rate for each type of row operation.\n\nIf the innodb_status_output_locks system variable is set to 1, extended lock information will be displayed.\n\nExample output:\n\n`sql\n=====================================\n2019-09-06 12:44:13 0x7f93cc236700 INNODB MONITOR OUTPUT\n=====================================\nPer second averages calculated from the last 4 seconds\n-----------------\nBACKGROUND THREAD\n-----------------\nsrv_master_thread loops: 2 srv_active, 0 srv_shutdown, 83698 srv_idle\nsrv_master_thread log flush and writes: 83682\n----------\nSEMAPHORES\n----------\nOS WAIT ARRAY INFO: reservation count 15\nOS WAIT ARRAY INFO: signal count 8\nRW-shared spins 0, rounds 20, OS waits 7\nRW-excl spins 0, rounds 0, OS waits 0\nRW-sx spins 0, rounds 0, OS waits 0\nSpin rounds per wait: 20.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx\n------------\nTRANSACTIONS\n------------\nTrx id counter 236\nPurge done for trx''s n:o < 236 undo n:o < 0 state: running\nHistory list length 22\nLIST OF TRANSACTIONS FOR EACH SESSION:\n---TRANSACTION 421747401994584, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n---TRANSACTION 421747401990328, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n--------\nFILE I/O\n--------\nI/O thread 0 state: waiting for completed aio requests (insert buffer thread)\nI/O thread 1 state: waiting for completed aio requests (log thread)\nI/O thread 2 state: waiting for completed aio requests (read thread)\nI/O thread 3 state: waiting for completed aio requests (read thread)\nI/O thread 4 state: waiting for completed aio requests (read thread)\nI/O thread 5 state: waiting for completed aio requests (read thread)\nI/O thread 6 state: waiting for completed aio requests (write thread)\nI/O thread 7 state: waiting for completed aio requests (write thread)\nI/O thread 8 state: waiting for completed aio requests (write thread)\nI/O thread 9 state: waiting for completed aio requests (write thread)\nPending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,\n ibuf aio reads:, log i/o''s:, sync i/o''s:\nPending flushes (fsync) log: 0; buffer pool: 0\n286 OS file reads, 171 OS file writes, 22 OS fsyncs\n0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s\n-------------------------------------\nINSERT BUFFER AND ADAPTIVE HASH INDEX\n-------------------------------------\nIbuf: size 1, free list len 0, seg size 2, 0 merges\nmerged operations:\n insert 0, delete mark 0, delete 0\ndiscarded operations:\n insert 0, delete mark 0, delete 0\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\n0.00 hash searches/s, 0.00 non-hash searches/s\n---\nLOG\n---\nLog sequence number 445926\nLog flushed up to   445926\nPages flushed up to 445926\nLast checkpoint at  445917\n0 pending log flushes, 0 pending chkp writes\n18 log i/o''s done, 0.00 log i/o''s/second\n----------------------\nBUFFER POOL AND MEMORY\n----------------------\nTotal large memory allocated 167772160\nDictionary memory allocated 50768\nBuffer pool size   8012\nFree buffers       7611\nDatabase pages     401\nOld database pages 0\nModified db pages  0\nPercent of dirty pages(LRU & free pages): 0.000\nMax dirty pages percent: 75.000\nPending reads 0\nPending writes: LRU 0, flush list 0, single page 0\nPages made young 0, not young 0\n0.00 youngs/s, 0.00 non-youngs/s\nPages read 264, created 137, written 156\n0.00 reads/s, 0.00 creates/s, 0.00 writes/s\nNo buffer pool page gets since the last printout\nPages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s\nLRU len: 401, unzip_LRU len: 0\nI/O sum[0]:cur[0], unzip sum[0]:cur[0]\n--------------\nROW OPERATIONS\n--------------\n0 queries inside InnoDB, 0 queries in queue\n0 read views open inside InnoDB\nProcess ID=4267, Main thread ID=140272021272320, state: sleeping\nNumber of rows inserted 1, updated 0, deleted 0, read 1\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\nNumber of system rows inserted 0, updated 0, deleted 0, read 0\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\n----------------------------\nEND OF INNODB MONITOR OUTPUT\n============================\n``\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-engine-innodb-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-engine-innodb-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (570, 26, 'SHOW ENGINE', 'Syntax\n------\n\nSHOW ENGINE [engine-name] {STATUS | MUTEX}\n\nDescription\n-----------\n\nSHOW ENGINE displays operational information about a storage engine. The following statements currently are supported:\n\n``sql\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\nSHOW ENGINE ROCKSDB STATUS\n`\n\nIf the Sphinx Storage Engine is installed, the following is also supported:\n\n`sql\nSHOW ENGINE SPHINX STATUS\n`\n\nSHOW ENGINE INNODB STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the standard InnoDB Monitor about the state of the InnoDB storage engine. See SHOW ENGINE INNODB STATUS for more.\n\nSHOW ENGINE INNODB MUTEX\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics.\n\nThe statement displays the following output fields:\n\n Type: Always InnoDB.\n Name: The source file where the mutex is implemented, and the line number in the file where the mutex is created. The line number is dependent on the MariaDB version.\n Status: This field displays the following values if UNIV_DEBUG was defined at compilation time (for example, in include/univ.h in the InnoDB part of the source tree). Only the os_waits value is displayed if UNIV_DEBUG was not defined. Without UNIV_DEBUG, the information on which the output is based is insufficient to distinguish regular mutexes and mutexes that protect rw-locks (which allow multiple readers or a single writer). Consequently, the output may appear to contain multiple rows for the same mutex.\n   count indicates how many times the mutex was requested.\n   spin_waits indicates how many times the spinlock had to run.\n   spin_rounds indicates the number of spinlock rounds. (spin_rounds divided by spin_waits provides the average round count.)\n   os_waits indicates the number of operating system waits. This occurs when the spinlock did not work (the mutex was not locked during the spinlock and it was necessary to yield to the operating system and wait).\n   os_yields indicates the number of times a the thread trying to lock a mutex gave up its timeslice and yielded to the operating system (on the presumption that allowing other threads to run will free the mutex so that it can be locked).\n   os_wait_times indicates the amount of time (in ms) spent in operating system waits, if the timed_mutexes system variable is 1 (ON). If timed_mutexes is 0 (OFF), timing is disabled, so os_wait_times is 0. timed_mutexes is off by default.\n\nInformation from this statement can be used to diagnose system problems. For example, large values of spin_waits and spin_rounds may indicate scalability problems.\n\nThe information_schema.INNODB_MUTEXES table provides similar information.\n\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nThis statement shows how much memory is used for performance_schema tables and internal buffers.\n\nThe output contains the following fields:\n\n Type: Always performance_schema.\n Name: The name of a table, the name of an internal buffer, or the performance_schema word, followed by a dot and an attribute. Internal buffers names are enclosed by parenthesis. performance_schema means that the attribute refers to the whole database (it is a total).\n Status: The value for the attribute.\n\nThe following attributes are shown, in this order, for all tables:\n\n row_size: The memory used for an individual record. This value will never change.\n row_count: The number of rows in the table or buffer. For some tables, this value depends on a server system variable.\n memory: For tables and performance_schema, this is the result of row_size \\ row_count`.\n\nFor internal buffers, the attributes are:\n\n count\n size\n\nSHOW ENGINE ROCKSDB STATUS\n\nSee also MyRocks Performance Troubleshooting\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-engine', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-engine');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (571, 26, 'SHOW ENGINES', 'Syntax\n------\n\nSHOW [STORAGE] ENGINES\n\nDescription\n-----------\n\nSHOW ENGINES displays status information about the server''s storage engines. This is particularly useful for checking whether a storage engine is supported, or to see what the default engine is.SHOW TABLE TYPES is a deprecated synonym.\n\nThe information_schema.ENGINES table provides the same information.\n\nSince storage engines are plugins, different information about them is also shown in the information_schema.PLUGINS table and by the SHOW PLUGINS statement.\n\nNote that both MySQL''s InnoDB and Percona''s XtraDB replacement are labeled as InnoDB. However, if XtraDB is in use, it will be specified in the COMMENT field. See XtraDB and InnoDB. The same applies to FederatedX.\n\nThe output consists of the following columns:\n\n Engine indicates the engine''s name.\n Support indicates whether the engine is installed, and whether it is the default engine for the current session.\n Comment is a brief description.\n Transactions, XA and Savepoints indicate whether transactions, XA transactions and transaction savepoints are supported by the engine.\n\nExamples\n--------\n\nSHOW ENGINES\\G\n************************ 1. row *********************\n      Engine: InnoDB\n     Support: DEFAULT\n     Comment: Supports transactions, row-level locking, and foreign keys\nTransactions: YES\n          XA: YES\n  Savepoints: YES\n********************* 2. row *********************\n      Engine: CSV\n     Support: YES\n     Comment: CSV storage engine\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 3. row *********************\n      Engine: MyISAM\n     Support: YES\n     Comment: MyISAM storage engine\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 4. row *********************\n      Engine: BLACKHOLE\n     Support: YES\n     Comment: /dev/null storage engine (anything you write to it disappears)\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 5. row *********************\n      Engine: FEDERATED\n     Support: YES\n     Comment: FederatedX pluggable storage engine\nTransactions: YES\n          XA: NO\n  Savepoints: YES\n********************* 6. row *********************\n      Engine: MRG_MyISAM\n     Support: YES\n     Comment: Collection of identical MyISAM tables\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 7. row *********************\n      Engine: ARCHIVE\n     Support: YES\n     Comment: Archive storage engine\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 8. row *********************\n      Engine: MEMORY\n     Support: YES\n     Comment: Hash based, stored in memory, useful for temporary tables\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 9. row *********************\n      Engine: PERFORMANCE_SCHEMA\n     Support: YES\n     Comment: Performance Schema\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n********************* 10. row ************************\n      Engine: Aria\n     Support: YES\n     Comment: Crash-safe tables with MyISAM heritage\nTransactions: NO\n          XA: NO\n  Savepoints: NO\n10 rows in set (0.00 sec)\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-engines', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-engines');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (572, 26, 'SHOW ERRORS', 'Syntax\n------\n\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT() ERRORS\n\nDescription\n-----------\n\nThis statement is similar to SHOW WARNINGS, except that instead of displaying errors, warnings, and notes, it displays only errors.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nThe SHOW COUNT() ERRORS statement displays the number of errors. You can also retrieve this number from the error_count variable.\n\n``sql\nSHOW COUNT() ERRORS;\nSELECT @@error_count;\n``\n\nThe value of error_count might be greater than the number of messages displayed by SHOW WARNINGS if the max_error_count system variable is set so low that not all messages are stored.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nExamples\n--------\n\nSELECT f();\nERROR 1305 (42000): FUNCTION f does not exist\n\nSHOW COUNT() ERRORS;\n+-----------------------+\n| @@session.error_count |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSHOW ERRORS;\n+-------+------+---------------------------+\n| Level | Code | Message                   |\n+-------+------+---------------------------+\n| Error | 1305 | FUNCTION f does not exist |\n+-------+------+---------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-errors', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-errors');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (573, 26, 'SHOW EVENTS', 'Syntax\n------\n\nSHOW EVENTS [{FROM | IN} schema_name]\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nShows information about Event Manager events (created with CREATE EVENT). Requires the EVENT privilege. Without any arguments, SHOW EVENTS lists all of the events in the current schema:\n\n``sql\nSELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora    | myschema |\n+----------------+----------+\n\nSHOW EVENTS\\G\n************************ 1. row ************************\n                  Db: myschema\n                Name: e_daily\n             Definer: jon@ghidora\n           Time zone: SYSTEM\n                Type: RECURRING\n          Execute at: NULL\n      Interval value: 10\n      Interval field: SECOND\n              Starts: 2006-02-09 10:41:23\n                Ends: NULL\n              Status: ENABLED\n          Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n`\n\nTo see the event action, use SHOW CREATE EVENT instead, or look at the information_schema.EVENTS table.\n\nTo see events for a specific schema, use the FROM clause. For example, to see events for the test schema, use the following statement:\n\n`sql\nSHOW EVENTS FROM test;\n`\n\nThe LIKE clause, if present, indicates which event names to match. The WHERE` clause can be given to select rows using more general conditions, as discussed in Extended Show.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-events', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-events');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (574, 26, 'SHOW EXPLAIN', 'Syntax\n------\n\nSHOW EXPLAIN [FORMAT=JSON] FOR <connection_id>;\nEXPLAIN [FORMAT=JSON] FOR CONNECTION <connection_id>;\n\nDescription\n-----------\n\nThe SHOW EXPLAIN command allows one to get an EXPLAIN (that is, a description of a query plan) of a query running in a certain connection.\n\n``sql\nSHOW EXPLAIN FOR <connection_id>;\n`\n\nwill produce an EXPLAIN output for the query that connection number connection_id is running. The connection id can be obtained with SHOW PROCESSLIST.\n\n`sql\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n| id   | select_type | table | type  | possible_keys | key  | key_len | ref  | rows    | Extra       |\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n|    1 | SIMPLE      | tbl   | index | NULL          | a    | 5       | NULL | 1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n1 row in set, 1 warning (0.00 sec)\n`\n\nThe output is always accompanied with a warning which shows the query the target connection is running (this shows what the EXPLAIN is for):\n\n`sql\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1003 | select sum(a) from tbl |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n`\n\nEXPLAIN FOR CONNECTION\n\nThe EXPLAIN FOR CONNECTION syntax was added for MySQL compatibility.\n\nFORMAT=JSON\n\nSHOW EXPLAIN [FORMAT=JSON] FOR <connection_id> extends SHOW EXPLAIN to return more detailed JSON output.\n\nEXPLAIN FOR CONNECTION and FORMAT=JSON are not available.\n\nPossible Errors\n\nThe output can be only produced if the target connection is _currently_ running a query, which has a ready query plan. If this is not the case, the output will be:\n\n`sql\nSHOW EXPLAIN FOR 2;\nERROR 1932 (HY000): Target is not running an EXPLAINable command\n`\n\nYou will get this error when:\n\n The target connection is not running a command for which one can run EXPLAIN;\n The target connection is running a command for which one can run EXPLAIN, but there is no query plan yet (for example, tables are open and locks are acquired before the query plan is produced).\n\nDifferences Between SHOW EXPLAIN and EXPLAIN Outputs\n\nBackground\n\nIn MySQL, EXPLAIN execution takes a slightly different route from the way the real query (typically the SELECT) is optimized. This is unfortunate, and has caused a number of bugs in EXPLAIN. (For example, see MDEV-326, MDEV-410, and lp:1013343.lp:992942 is not directly about EXPLAIN, but it also would not have existed if MySQL didn''t try to delete parts of a query plan in the middle of the query)\n\nSHOW EXPLAIN examines a running SELECT, and hence its output may be slightly different from what EXPLAIN SELECT would produce. We did our best to make sure that either the difference is negligible, or SHOW EXPLAIN''s output is closer to reality than EXPLAIN''s output.\n\nList of Recorded Differences\n\n SHOW EXPLAIN may have Extra=''no matching row in const table'', where EXPLAIN would produce Extra=''Impossible WHERE ...''\n For queries with subqueries, SHOW EXPLAIN may print select_type==PRIMARY where regular EXPLAIN used to print select_type==SIMPLE, or vice versa.\n\nRequired Permissions\n\nRunning SHOW EXPLAIN` requires the same permissions as running SHOW PROCESSLIST would.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-explain', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-explain');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (575, 26, 'SHOW FUNCTION CODE', 'Syntax\n------\n\nSHOW FUNCTION CODE func_name\n\nDescription\n-----------\n\nSHOW FUNCTION CODE shows a representation of the internal implementation of the stored function.\n\nIt is similar to SHOW PROCEDURE CODE but for stored functions.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-function-code', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-function-code');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (576, 26, 'SHOW FUNCTION STATUS', 'Syntax\n------\n\nSHOW FUNCTION STATUS\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored functions.\n\nThe LIKE clause, if present on its own, indicates which function names to match.\n\nThe WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe information_schema.ROUTINES table contains more detailed information.\n\nExamples\n--------\n\nSHOW FUNCTION STATUS\\G\n************************ 1. row ************************\n                  Db: test\n                Name: VatCents\n                Type: FUNCTION\n             Definer: root@localhost\n            Modified: 2013-06-01 12:40:31\n             Created: 2013-06-01 12:40:31\n       Security_type: DEFINER\n             Comment: \ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-function-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-function-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (577, 26, 'SHOW GRANTS', 'Syntax\n------\n\nSHOW GRANTS [FOR user|role]\n\nDescription\n-----------\n\nThe SHOW GRANTS statement lists privileges granted to a particular user or role.\n\nUsers\n\nThe statement lists the GRANT statement or statements that must be issued to duplicate the privileges that are granted to a MariaDB user account. The account is named using the same format as for theGRANT statement; for example, ''jeffrey''@''localhost''. If you specify only the user name part of the account name, a host name part of ''%'' is used. For additional information about specifying account names, see GRANT.\n\n``sql\nSHOW GRANTS FOR ''root''@''localhost'';\n+---------------------------------------------------------------------+\n| Grants for root@localhost                                           |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON . TO ''root''@''localhost'' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n`\n\nTo list the privileges granted to the account that you are using to connect to the server, you can use any of the following statements:\n\n`sql\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n`\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is used in DEFINER context (such as within a stored procedure that is defined withSQL SECURITY DEFINER), the grants displayed are those of the definer and not the invoker.\n\nRoles\n\nSHOW GRANTS can also be used to view the privileges granted to a role.\n\nExamples\n--------\n\nSHOW GRANTS FOR journalist;\n+------------------------------------------+\n| Grants for journalist                    |\n+------------------------------------------+\n| GRANT USAGE ON . TO ''journalist''       |\n| GRANT DELETE ON test`.* TO ''journalist'' |\n+------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-grants', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-grants');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (578, 26, 'SHOW INDEX\\_STATISTICS', 'Syntax\n------\n\nSHOW INDEX_STATISTICS\n\nDescription\n-----------\n\nThe information_schema.INDEX_STATISTICS table shows statistics on index usage and makes it possible to do such things as locating unused indexes and generating the commands to remove them.\n\nSHOW INDEX_STATISTICS is replaced by the generic SHOW TABLE STATISTICS statement.\n\nThe SHOW INDEX_STATISTICS statement was introduced in MariaDB 5.2 as part of the User Statistics feature. It was removed as a separate statement in MariaDB 10.1.1, but effectively replaced by the generic SHOW TABLE STATISTICS statement.\n\nThe userstat system variable must be set to 1 to activate this feature. See the User Statistics and information_schema.INDEX_STATISTICS table for more information.\n\nExamples\n--------\n\nSHOW INDEX_STATISTICS;\n+--------------+-------------------+------------+-----------+\n| Table_schema | Table_name        | Index_name | Rows_read |\n+--------------+-------------------+------------+-----------+\n| test         | employees_example | PRIMARY    |         1 |\n+--------------+-------------------+------------+-----------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-index-statistics', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-index-statistics');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (579, 26, 'SHOW INDEX', 'Syntax\n------\n\nSHOW {INDEX | INDEXES | KEYS} \n FROM tbl_name [FROM db_name]\n [WHERE expr]\n\nDescription\n-----------\n\nSHOW INDEX returns table index information. The format resembles that of the SQLStatistics call in ODBC.\n\nYou can use db_name.tbl_name as an alternative to thetbl_name FROM db_name syntax. These two statements are equivalent:\n\n``sql\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n`\n\nSHOW KEYS and SHOW INDEXES are synonyms for SHOW INDEX.\n\nYou can also list a table''s indexes with the mariadb-show command:\n\n`sql\nmariadb-show -k db_name tbl_name\n`\n\nThe information_schema.STATISTICS table stores similar information.\n\nThe following fields are returned by SHOW INDEX.\n\n| Field          | Description                                                                                                                                                                                                                                                                              |\n| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Table          | Table name                                                                                                                                                                                                                                                                               |\n| Non_unique    | 1 if the index permits duplicate values, 0 if values must be unique.                                                                                                                                                                                                                     |\n| Key_name      | Index name. The primary key is always named PRIMARY.                                                                                                                                                                                                                                     |\n| Seq_in_index | The column''s sequence in the index, beginning with 1.                                                                                                                                                                                                                                    |\n| Column_name   | Column name.                                                                                                                                                                                                                                                                             |\n| Collation      | Either A, if the column is sorted in ascending order in the index, or NULL if it''s not sorted.                                                                                                                                                                                           |\n| Cardinality    | Estimated number of unique values in the index. The cardinality statistics are calculated at various times, and can help the optimizer make improved decisions.                                                                                                                          |\n| Sub_part      | NULL if the entire column is included in the index, or the number of included characters if not.                                                                                                                                                                                         |\n| Packed         | NULL if the index is not packed, otherwise how the index is packed.                                                                                                                                                                                                                      |\n| Null           | NULL if NULL values are permitted in the column, an empty string if NULLs are not permitted.                                                                                                                                                                                             |\n| Index_type    | The index type, which can be BTREE, FULLTEXT, HASH or RTREE. See Storage Engine Index Types.                                                                            |\n| Comment        | Other information, such as whether the index is disabled.                                                                                                                                                                                                                                |\n| Index_comment | Contents of the COMMENT attribute when the index was created.                                                                                                                                                                                                                            |\n| Ignored        | Whether or not an index will be ignored by the optimizer. See Ignored Indexes. From MariaDB 10.6.0. |\n\nThe WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nCREATE TABLE IF NOT EXISTS employees_example (\n  id INT(11) NOT NULL AUTO_INCREMENT,\n  first_name VARCHAR(30) NOT NULL,\n  last_name VARCHAR(40) NOT NULL,\n  position VARCHAR(25) NOT NULL,\n  home_address VARCHAR(50) NOT NULL,\n  home_phone VARCHAR(12) NOT NULL,\n  employee_code VARCHAR(25) NOT NULL,\n  PRIMARY KEY (id),\n  UNIQUE KEY employee_code (employee_code),\n  KEY first_name (first_name,last_name)\n) ENGINE=Aria;\n\nINSERT INTO employees_example (first_name, last_name, position, home_address, home_phone, employee_code`)\n  VALUES\n  (''Mustapha'', ''Mond'', ''Chief Executive Officer'', ''692 Promiscuous Plaza'', ''326-555-3492'', ''MM1''),\n  (''Henry'', ''Foster'', ''Store Manager'', ''314 Savage Circle'', ''326-555-3847'', ''HF1''),\n  (''Bernard'', ''Marx'', ''Cashier'', ''1240 Ambient Avenue'', ''326-555-8456'', ''BM1''),\n  (''Lenina'', ''Crowne'', ''Cashier'', ''281 Bumblepuppy Boulevard'', ''328-555-2349'', ''LC1''),\n  (''Fanny'', ''Crowne'', ''Restocker'', ''1023 Bokanovsky Lane'', ''326-555-6329'', ''FC1''),\n  (''Helmholtz'', ''Watson'', ''Janitor'', ''944 Soma Court'', ''329-555-2478'', ''HW1'');\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-index', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-index');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (580, 26, 'SHOW INNODB STATUS (removed)', 'Syntax\n------\n\nSHOW INNODB STATUS\n\nDescription\n-----------\n\nThis is a deprecated synonym for SHOW ENGINE INNODB STATUS. It was removed in MariaDB and MySQL 5.5.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-innodb-status-removed', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-innodb-status-removed');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (581, 26, 'SHOW LOCALES', 'Syntax\n------\n\nSHOW LOCALES\n\nDescription\n-----------\n\nSHOW LOCALES was introduced as part of the Information Schema plugin extension.\n\nSHOW LOCALES is used to return locales information as part of the Locales plugin. It requires this plugin to be installed to work.\n\nWhile the information_schema.LOCALES table has 8 columns, the SHOW LOCALES statement will only display 4 of them:\n\nExamples\n--------\n\nSHOW LOCALES;\n+-----+-------+-------------------------------------+------------------------+\n| Id  | Name  | Description                         | Error_Message_Language |\n+-----+-------+-------------------------------------+------------------------+\n|   0 | en_US | English - United States             | english                |\n|   1 | en_GB | English - United Kingdom            | english                |\n|   2 | ja_JP | Japanese - Japan                    | japanese               |\n|   3 | sv_SE | Swedish - Sweden                    | swedish                |\n...\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-locales', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-locales');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (582, 26, 'SHOW OPEN TABLES', 'Syntax\n------\n\nSHOW OPEN TABLES [FROM db_name]\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open in the table cache. See table-cache.html.\n\nThe FROM and LIKE clauses may be used.\n\nThe FROM clause, if present, restricts the tables shown to those present in thedb_name database.\n\nThe LIKE clause, if present on its own, indicates which table names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n| Column       | Description                                                                         |\n| ------------ | ----------------------------------------------------------------------------------- |\n| Database     | Database name.                                                                      |\n| Name         | Table name.                                                                         |\n| In_use      | Number of table instances being used.                                               |\n| Name_locked | 1 if the table is name-locked, e.g. if it is being dropped or renamed, otherwise 0. |\n\nLOCK TABLE... WRITE acquires a strong MDL lock, and concurrent connections will wait on this MDL lock, so any subsequent LOCK TABLE... WRITE will not increment In_use.\n\nBefore MariaDB 5.5, each use of, for example, LOCK TABLE ... WRITE would increment In_use for that table. With the implementation of the metadata locking improvements in MariaDB 5.5, LOCK TABLE... WRITE acquires a strong MDL lock, and concurrent connections will wait on this MDL lock, so any subsequent LOCK TABLE... WRITE will not increment In_use.\n\nExamples\n--------\n\nSHOW OPEN TABLES;\n+----------+---------------------------+--------+-------------+\n| Database | Table                     | In_use | Name_locked |\n+----------+---------------------------+--------+-------------+\n...\n| test     | xjson                     |      0 |           0 |\n| test     | jauthor                   |      0 |           0 |\n| test     | locks                     |      1 |           0 |\n...\n+----------+---------------------------+--------+-------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-open-tables', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-open-tables');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (583, 26, 'SHOW PACKAGE BODY STATUS', 'Syntax\n------\n\nSHOW PACKAGE BODY STATUS\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE BODY STATUS statement returns characteristics of stored package bodies (implementations), such as the database, name, type, creator, creation and modification dates, and character set information. A similar statement, SHOW PACKAGE STATUS, displays information about stored package specifications.\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed information.\n\nExamples\n--------\n\nSHOW PACKAGE BODY STATUS LIKE ''pkg1''\\G\n************************ 1. row ************************\n                  Db: test\n                Name: pkg1\n                Type: PACKAGE BODY\n             Definer: root@localhost\n            Modified: 2018-02-27 14:44:14\n             Created: 2018-02-27 14:44:14\n       Security_type: DEFINER\n             Comment: This is my first package body\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-package-body-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-package-body-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (584, 26, 'SHOW PACKAGE STATUS', 'Syntax\n------\n\nSHOW PACKAGE STATUS\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE STATUS statement returns characteristics of stored package specifications, such as the database, name, type, creator, creation and modification dates, and character set information. A similar statement, SHOW PACKAGE BODY STATUS, displays information about stored package bodies (i.e. implementations).\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed information.\n\nExamples\n--------\n\nSHOW PACKAGE STATUS LIKE ''pkg1''\\G\n************************ 1. row ************************\n                  Db: test\n                Name: pkg1\n                Type: PACKAGE\n             Definer: root@localhost\n            Modified: 2018-02-27 14:38:15\n             Created: 2018-02-27 14:38:15\n       Security_type: DEFINER\n             Comment: This is my first package\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-package-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-package-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (585, 5, 'SHOW PLUGINS SONAME', 'Syntax\n------\n\nSHOW PLUGINS SONAME { library | LIKE ''pattern'' | WHERE expr };\n\nDescription\n-----------\n\nSHOW PLUGINS SONAME displays information about compiled-in and all server plugins in the plugin_dir directory, including plugins that haven''t been installed.\n\nExamples\n--------\n\nSHOW PLUGINS SONAME ''ha_example.so'';\n+----------+---------------+----------------+---------------+---------+\n| Name     | Status        | Type           | Library       | License |\n+----------+---------------+----------------+---------------+---------+\n| EXAMPLE  | NOT INSTALLED | STORAGE ENGINE | ha_example.so | GPL     |\n| UNUSABLE | NOT INSTALLED | DAEMON         | ha_example.so | GPL     |\n+----------+---------------+----------------+---------------+---------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-plugins-soname', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-plugins-soname');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (586, 5, 'SHOW PLUGINS', 'Syntax\n------\n\nSHOW PLUGINS;\n\nDescription\n-----------\n\nSHOW PLUGINS displays information about installed plugins. The Library column indicates the plugin library - if it is NULL, the plugin is built-in and cannot be uninstalled.\n\nThe PLUGINS table in the information_schema database contains more detailed information.\n\nFor specific information about storage engines (a particular type of plugin), see the information_schema.ENGINES table and the SHOW ENGINES statement.\n\nExamples\n--------\n\nSHOW PLUGINS;\n+----------------------------+----------+--------------------+-------------+---------+\n| Name                       | Status   | Type               | Library     | License |\n+----------------------------+----------+--------------------+-------------+---------+\n| binlog                     | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| mysql_native_password      | ACTIVE   | AUTHENTICATION     | NULL        | GPL     |\n| mysql_old_password         | ACTIVE   | AUTHENTICATION     | NULL        | GPL     |\n| MRG_MyISAM                 | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| MyISAM                     | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| CSV                        | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| MEMORY                     | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| FEDERATED                  | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| PERFORMANCE_SCHEMA         | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| Aria                       | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| InnoDB                     | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| INNODB_TRX                 | ACTIVE   | INFORMATION SCHEMA | NULL        | GPL     |\n...\n| INNODB_SYS_FOREIGN         | ACTIVE   | INFORMATION SCHEMA | NULL        | GPL     |\n| INNODB_SYS_FOREIGN_COLS    | ACTIVE   | INFORMATION SCHEMA | NULL        | GPL     |\n| SPHINX                     | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| ARCHIVE                    | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| BLACKHOLE                  | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| FEEDBACK                   | DISABLED | INFORMATION SCHEMA | NULL        | GPL     |\n| partition                  | ACTIVE   | STORAGE ENGINE     | NULL        | GPL     |\n| pam                        | ACTIVE   | AUTHENTICATION     | auth_pam.so | GPL     |\n+----------------------------+----------+--------------------+-------------+---------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-plugins', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-plugins');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (587, 26, 'SHOW PRIVILEGES', 'Syntax\n------\n\nSHOW PRIVILEGES\n\nDescription\n-----------\n\nSHOW PRIVILEGES shows the list of system privileges that the MariaDB server supports. The exact list of privileges depends on the version of your server.\n\nSHOW PRIVILEGES shows the list of system privileges that the MariaDB server supports. The exact list of privileges depends on the version of your server.\n\nNote that before MariaDB 10.3.23, MariaDB 10.4.13 and MariaDB 10.5.2 , the Delete history privilege displays as Delete versioning rows (MDEV-20382).\n\nExamples\n--------\n\nSHOW PRIVILEGES;\n+--------------------------+---------------------------------------+--------------------------------------------------------------------+\n| Privilege                | Context                               | Comment                                                            |\n+--------------------------+---------------------------------------+--------------------------------------------------------------------+\n| Alter                    | Tables                                | To alter the table                                                 |\n| Alter routine            | Functions,Procedures                  | To alter or drop stored functions/procedures                       |\n| Create                   | Databases,Tables,Indexes              | To create new databases and tables                                 |\n| Create routine           | Databases                             | To use CREATE FUNCTION/PROCEDURE                                   |\n| Create temporary tables  | Databases                             | To use CREATE TEMPORARY TABLE                                      |\n| Create view              | Tables                                | To create new views                                                |\n| Create user              | Server Admin                          | To create new users                                                |\n| Delete                   | Tables                                | To delete existing rows                                            |\n| Delete history           | Tables                                | To delete versioning table historical rows                         |\n| Drop                     | Databases,Tables                      | To drop databases, tables, and views                               |\n| Event                    | Server Admin                          | To create, alter, drop and execute events                          |\n| Execute                  | Functions,Procedures                  | To execute stored routines                                         |\n| File                     | File access on server                 | To read and write files on the server                              |\n| Grant option             | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess                |\n| Index                    | Tables                                | To create or drop indexes                                          |\n| Insert                   | Tables                                | To insert data into tables                                         |\n| Lock tables              | Databases                             | To use LOCK TABLES (together with SELECT privilege)                |\n| Process                  | Server Admin                          | To view the plain text of currently executing queries              |\n| Proxy                    | Server Admin                          | To make proxy user possible                                        |\n| References               | Databases,Tables                      | To have references on tables                                       |\n| Reload                   | Server Admin                          | To reload or refresh tables, logs and privileges                   |\n| Binlog admin             | Server                                | To purge binary logs                                               |\n| Binlog monitor           | Server                                | To use SHOW BINLOG STATUS and SHOW BINARY LOG                      |\n| Binlog replay            | Server                                | To use BINLOG (generated by mariadb-binlog)                        |\n| Replication master admin | Server                                | To monitor connected slaves                                        |\n| Replication slave admin  | Server                                | To start/stop slave and apply binlog events                        |\n| Slave monitor            | Server                                | To use SHOW SLAVE STATUS and SHOW RELAYLOG EVENTS                  |\n| Replication slave        | Server Admin                          | To read binary log events from the master                          |\n| Select                   | Tables                                | To retrieve rows from table                                        |\n| Show databases           | Server Admin                          | To see all databases with SHOW DATABASES                           |\n| Show view                | Tables                                | To see views with SHOW CREATE VIEW                                 |\n| Shutdown                 | Server Admin                          | To shut down the server                                            |\n| Super                    | Server Admin                          | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.                |\n| Trigger                  | Tables                                | To use triggers                                                    |\n| Create tablespace        | Server Admin                          | To create/alter/drop tablespaces                                   |\n| Update                   | Tables                                | To update existing rows                                            |\n| Set user                 | Server                                | To create views and stored routines with a different definer       |\n| Federated admin          | Server                                | To execute the CREATE SERVER, ALTER SERVER, DROP SERVER statements |\n| Connection admin         | Server                                | To bypass connection limits and kill other users'' connections      |\n| Read_only admin          | Server                                | To perform write operations even if @@read_only=ON                 |\n| Usage                    | Server Admin                          | No privileges - allow connect only                                 |\n+--------------------------+---------------------------------------+--------------------------------------------------------------------+\n41 rows in set (0.000 sec)\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-privileges', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-privileges');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (588, 26, 'SHOW PROCEDURE CODE', 'Syntax\n------\n\nSHOW PROCEDURE CODE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension that is available only for servers that have been built with debugging support. It displays a representation of the internal implementation of the named stored procedure. A similar statement, SHOW FUNCTION CODE, displays information about stored functions.\n\nBoth statements require that you be the owner of the routine or have SELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result set. Each row in the result set corresponds to one "instruction" in the routine. The first column is Pos, which is an ordinal number beginning with 0. The second column is Instruction, which contains an SQL statement (usually changed from the original source), or a directive which has meaning only to the stored-routine handler.\n\nExamples\n--------\n\nDELIMITER //\n\nCREATE PROCEDURE p1 ()\n  BEGIN\n    DECLARE fanta INT DEFAULT 55;\n    DROP TABLE t2;\n    LOOP\n      INSERT INTO t3 VALUES (fanta);\n      END LOOP;\n  END//\nQuery OK, 0 rows affected (0.00 sec)\n\nSHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction                            |\n+-----+----------------------------------------+\n|   0 | set fanta@0 55                         |\n|   1 | stmt 9 "DROP TABLE t2"                 |\n|   2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n|   3 | jump 2                                 |\n+-----+----------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-procedure-code', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-procedure-code');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (589, 26, 'SHOW PROCEDURE STATUS', 'Syntax\n------\n\nSHOW PROCEDURE STATUS\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns characteristics of a stored procedure, such as the database, name, type, creator, creation and modification dates, and character set information. A similar statement, SHOW FUNCTION STATUS, displays information about stored functions.\n\nThe LIKE clause, if present, indicates which procedure or function names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed information.\n\nExamples\n--------\n\nSHOW PROCEDURE STATUS LIKE ''p1''\\G\n************************ 1. row ************************\n                  Db: test\n                Name: p1\n                Type: PROCEDURE\n             Definer: root@localhost\n            Modified: 2010-08-23 13:23:03\n             Created: 2010-08-23 13:23:03\n       Security_type: DEFINER\n             Comment: \ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-procedure-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-procedure-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (590, 26, 'SHOW PROCESSLIST', 'Syntax\n------\n\nSHOW [FULL] PROCESSLIST\n\nDescription\n-----------\n\nSHOW PROCESSLIST shows which threads are running. You can also get this information from the information_schema.PROCESSLIST table or the mariadb-admin processlist command. If you have the PROCESS privilege, you can see all threads. Otherwise, you can see only your own threads (that is, threads associated with the MariaDB account that you are using). If you do not use the FULL keyword, only the first 100 characters of each statement are shown in the Info field.\n\nThe columns shown in SHOW PROCESSLIST are:\n\n| Name     | Description                                                                                                                                                |\n| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Id       | The client''s thread ID.                                                                                                                                    |\n| User     | The username associated with the process.                                                                                                                  |\n| Host     | The host the client is connected to.                                                                                                                       |\n| db       | The default database of the process (NULL if no default).                                                                                                |\n| Command  | The command type. See Thread Command Values. |\n| Time     | The amount of time, in seconds, the process has been in its current state.                                                                                 |\n| State    | See Thread States.                                     |\n| Info     | The statement being executed.                                                                                                                              |\n| Progress | The total progress of the process (0-100%) (see Progress Reporting).                                                                |\n\nThe information_schema.PROCESSLIST table contains a number of additional columns. See TIME_MS column in information_schema.PROCESSLIST for differences in the TIME column between MariaDB and MySQL.\n\nNote that the PROGRESS field from the information schema, and the PROGRESS field from SHOW PROCESSLIST display different results. SHOW PROCESSLIST shows the total progress, while the information schema shows the progress for the current stage only.\n\nThreads can be killed using their thread_id or their query_id, with the KILL statement.\n\nSince queries on this table are locking, if the performance_schema is enabled, you may want to query the THREADS table instead.\n\nExamples\n--------\n\nSHOW PROCESSLIST;\n+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+\n| Id | User            | Host      | db   | Command | Time | State                  | Info             | Progress |\n+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+\n|  2 | event_scheduler | localhost | NULL | Daemon  | 2693 | Waiting on empty queue | NULL             |    0.000 |\n|  4 | root            | localhost | NULL | Query   |    0 | Table lock             | SHOW PROCESSLIST |    0.000 |\n+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-processlist', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-processlist');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (591, 26, 'SHOW PROFILE', 'Syntax\n------\n\nSHOW PROFILE [type [, type] ... ]\n    [FOR QUERY n]\n    [LIMIT row_count [OFFSET offset]]\n\ntype:\n    ALL\n  | BLOCK IO\n  | CONTEXT SWITCHES\n  | CPU\n  | IPC\n  | MEMORY\n  | PAGE FAULTS\n  | SOURCE\n  | SWAPS\n\nDescription\n-----------\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling information that indicates resource usage for statements executed during the course of the current session.\n\nProfiling is controlled by the profiling session variable, which has a default value of 0 (OFF). Profiling is enabled by setting profiling to 1 or ON:\n\n``sql\nSET profiling = 1;\n`\n\nSHOW PROFILES displays a list of the most recent statements sent to the master. The size of the list is controlled by the profiling_history_size session variable, which has a default value of 15. The maximum value is 100. Setting the value to 0 has the practical effect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILES andSHOW PROFILE, so you will find neither of those statements in the profile list. Malformed statements are profiled. For example,SHOW PROFILING is an illegal statement, and a syntax error occurs if you try to execute it, but it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement. Without the FOR QUERY n clause, the output pertains to the most recently executed statement. IfFOR QUERY n is included,SHOW PROFILE displays information for statement _n_. The values of _n_ correspond to the Query_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to _row_count_ rows. If LIMIT is given,OFFSET offset may be added to begin the output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The Status values are like the State values displayed by SHOW PROCESSLIST (see General Thread States), although there might be some minor differences in interpretation for the two statements for some status values.\n\nOptional type values may be specified to display specific additional types of information:\n\n ALL displays all information\n BLOCK IO displays counts for block input and output operations\n CONTEXT SWITCHES displays counts for voluntary and involuntary context switches\n CPU displays user and system CPU usage times\n IPC displays counts for messages sent and received\n MEMORY is not currently implemented\n PAGE FAULTS displays counts for major and minor page faults\n SOURCE displays the names of functions from the source code, together with the name and line number of the file in which the function occurs\n* SWAPS` displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling information is lost.\n\nThe information_schema.PROFILING table contains similar information.\n\nExamples\n--------\n\nSELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n|           0 |\n+-------------+\n\nSET profiling = 1;\n\nUSE test;\n\nDROP TABLE IF EXISTS t1;\n\nCREATE TABLE T1 (id INT);\n\nSHOW PROFILES;\n+----------+------------+--------------------------+\n| Query_ID | Duration   | Query                    |\n+----------+------------+--------------------------+\n|        1 | 0.00009200 | SELECT DATABASE()        |\n|        2 | 0.00023800 | show databases           |\n|        3 | 0.00018900 | show tables              |\n|        4 | 0.00014700 | DROP TABLE IF EXISTS t1  |\n|        5 | 0.24476900 | CREATE TABLE T1 (id INT) |\n+----------+------------+--------------------------+\n\nSHOW PROFILE;\n+----------------------+----------+\n| Status               | Duration |\n+----------------------+----------+\n| starting             | 0.000042 |\n| checking permissions | 0.000044 |\n| creating table       | 0.244645 |\n| After create         | 0.000013 |\n| query end            | 0.000003 |\n| freeing items        | 0.000016 |\n| logging slow query   | 0.000003 |\n| cleaning up          | 0.000003 |\n+----------------------+----------+\n\nSHOW PROFILE FOR QUERY 4;\n+--------------------+----------+\n| Status             | Duration |\n+--------------------+----------+\n| starting           | 0.000126 |\n| query end          | 0.000004 |\n| freeing items      | 0.000012 |\n| logging slow query | 0.000003 |\n| cleaning up        | 0.000002 |\n+--------------------+----------+\n\nSHOW PROFILE CPU FOR QUERY 5;\n+----------------------+----------+----------+------------+\n| Status               | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| starting             | 0.000042 | 0.000000 |   0.000000 |\n| checking permissions | 0.000044 | 0.000000 |   0.000000 |\n| creating table       | 0.244645 | 0.000000 |   0.000000 |\n| After create         | 0.000013 | 0.000000 |   0.000000 |\n| query end            | 0.000003 | 0.000000 |   0.000000 |\n| freeing items        | 0.000016 | 0.000000 |   0.000000 |\n| logging slow query   | 0.000003 | 0.000000 |   0.000000 |\n| cleaning up          | 0.000003 | 0.000000 |   0.000000 |\n+----------------------+----------+----------+------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-profile', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-profile');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (592, 26, 'SHOW PROFILES', 'Syntax\n------\n\nSHOW PROFILES\n\nDescription\n-----------\n\nThe SHOW PROFILES statement displays profiling information that indicates resource usage for statements executed during the course of the current session. It is used together with SHOW PROFILE.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-profiles', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-profiles');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (593, 26, 'SHOW QUERY\\_RESPONSE\\_TIME', 'Syntax\n------\n\nSHOW QUERY_RESPONSE_TIME\n\nDescription\n-----------\n\nIt is possible to use SHOW QUERY_RESPONSE_TIME as an alternative for retrieving information from the QUERY_RESPONSE_TIME plugin.\n\nThis was introduced as part of the Information Schema plugin extension.\n\nExamples\n--------\n\nSHOW 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\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-query_response_time', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-query_response_time');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (594, 26, 'SHOW RELAYLOG EVENTS', 'Syntax\n------\n\nSHOW RELAYLOG [''connection_name''] EVENTS\n    [IN ''log_name''] [FROM pos] [LIMIT [offset,] row_count]\n    [ FOR CHANNEL ''channel_name'']\n\nDescription\n-----------\n\nOn slaves, this command shows the events in the relay log. If ''log_name'' is not specified, the first relay log is shown.\n\nSyntax for the LIMIT clause is the same as for SELECT ... LIMIT.\n\nUsing the LIMIT clause is highly recommended because the SHOW RELAYLOG EVENTS command returns the complete contents of the relay log, which can be quite large.\n\nThis command does not return events related to setting user and system variables. If you need those, use mariadb-binlog.\n\nOn the master, this command does nothing.\n\nRequires the SLAVE MONITOR privilege.\n\nRequires the SLAVE MONITOR privilege (>= MariaDB 10.5.9), the REPLICATION SLAVE ADMIN privilege (>= MariaDB 10.5.2) or the REPLICATION SLAVE privilege (<= MariaDB 10.5.1).\n\nconnection_name\n\nIf there is only one nameless master, or the default master (as specified by the default_master_connection system variable) is intended, connection_name can be omitted. If provided, the SHOW RELAYLOG statement will apply to the specified master. connection_name is case-insensitive.\n\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical as using the channel_name directly after SHOW RELAYLOG.\n\nFOR CHANNEL is not available.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-relaylog-events', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-relaylog-events');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (595, 26, 'SHOW SLAVE HOSTS', 'Syntax\n------\n\nSHOW { SLAVE | REPLICA } HOSTS\n\nDescription\n-----------\n\nThis command is run on the master and displays a list of slaves that are currently registered with it. The output looks like this:\n\n``sql\nSHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id  | Host      | Port | Master_id |\n+------------+-----------+------+-----------+\n|  192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena    | 3306 | 192168011 |\n+------------+-----------+------+-----------+\n`\n\nServer_id: The unique server ID of the slave server, as configured in the server''s option file, or on the command line with --server-id=value.\n\nHost: The host name of the slave server, as configured in the server''s option file, or on the command line with --report-host=host_name (note that this can differ from the machine name as configured in the operating system). If a slave doesn''t configure --report-host explicitly, the value for the Host column is automatically extracted using the network connection''s host name or IP address.\n\nHost: The host name of the slave server, as configured in the server''s option file, or on the command line with --report-host=host_name (note that this can differ from the machine name as configured in the operating system). If a slave doesn''t configure --report-host explicitly, the value for the Host column is automatically extracted using the network connection''s host name or IP address. The Host value is left blank if a slave''s --report-host parameter is not configured.\n\nPort: The port the slave server is listening on.\n\nMaster_id: The unique server ID of the master server that the slave server is replicating from.\n\nRequires the REPLICATION MASTER ADMIN privilege.\n\nRequires the REPLICATION SLAVE privilege.\n\nSHOW REPLICA HOSTS\n\nSHOW REPLICA HOSTS is an alias for SHOW SLAVE HOSTS .\n\nSHOW REPLICA HOSTS is not available, use SHOW SLAVE HOSTS` instead.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-replica-hosts', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-replica-hosts');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (596, 26, 'SHOW SLAVE STATUS', 'Syntax\n------\n\nSHOW { SLAVE | REPLICA} ["connection_name"] STATUS [FOR CHANNEL "connection_name"]\n\nDescription\n-----------\n\nThis statement is to be run on a slave and provides status information on essential parameters of the slave threads.\n\nThis statement requires the SLAVE MONITOR privilege.\n\nThis statement requires the SLAVE MONITOR privilege.\n\nThis statement requires the REPLICATION SLAVE ADMIN privilege.\n\nMulti-Source\n\nThe ALL and "connection_name" options allow you to connect to many primaries at the same time.\n\nALL SLAVES gives you a list of all connections to the master nodes.\n\nALL SLAVES gives you a list of all connections to the master nodes.\n\nThe rows are sorted according to Connection_name.\n\nIf you specify a connection_name, you only get the information about that connection. If connection_name is not used, then the name set by default_master_connection is used. If the connection name doesn''t exist you will get an error:There is no master connection for ''xxx''.\n\nMariaDB starting with 10.7.0\n\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical to using the channel_name directly after SHOW SLAVE.\n\nColumn Descriptions\n\nThe order in which the columns appear depends on the MariaDB version. This means that extracting a column value is best done by comparing the field name instead of using a fixed offset into the row.\n\nThese columns can also be viewed/extracted from the INFORMATION_SCHEMA.SLAVE_STATUS table.\n\nThese columns cannot be viewed/extracted from the INFORMATION_SCHEMA.SLAVE_STATUS table.\n\nConnection_name: Name of the master connection. Returned with SHOW ALL SLAVES STATUS only.\n\nSlave_SQL_State: State of SQL thread. Returned with SHOW ALL SLAVES STATUSonly. See Slave SQL Thread States. Slave_IO_State: State of I/O thread. See Slave I/O Thread States.\n\nConnection_name: Name of the master connection. Returned with SHOW ALL SLAVES STATUS only.\n\nSlave_SQL_State: State of SQL thread. Returned with SHOW ALL SLAVES STATUS only. See Slave SQL Thread States. Slave_IO_State: State of I/O thread. See Slave I/O Thread States.\n\nMaster_host: Master host that the slave is connected to.\n\nMaster_user: Account user name being used to connect to the master.\n\nMaster_port: The port being used to connect to the master.\n\nConnect_Retry: Time in seconds between retries to connect. The default is 60. The CHANGE MASTER TO statement can set this. The master-retry-count option determines the maximum number of reconnection attempts.\n\nMaster_Log_File: Name of the master binary log file that the I/O thread is currently reading from.\n\nRead_Master_Log_Pos: Position up to which the I/O thread has read in the current master binary log file.\n\nRelay_Log_File: Name of the relay log file that the SQL thread is currently processing.\n\nRelay_Log_Pos: Position up to which the SQL thread has finished processing in the current relay log file.\n\nRelay_Master_Log_File: Name of the master binary log file that contains the most recent event executed by the SQL thread.\n\nSlave_IO_Running: Whether the slave I/O thread is running and connected (Yes), running but not connected to a master (Connecting) or not running (No).\n\nSlave_SQL_Running: Whether or not the SQL thread is running.\n\nReplicate_Do_DB: Databases specified for replicating with the replicate_do_db option.\n\nReplicate_Ignore_DB: Databases specified for ignoring with the replicate_ignore_db option.\n\nReplicate_Do_Table: Tables specified for replicating with the replicate_do_table option.\n\nReplicate_Ignore_Table: Tables specified for ignoring with the replicate_ignore_table option.\n\nReplicate_Wild_Do_Table: Tables specified for replicating with the replicate_wild_do_table option.\n\nReplicate_Wild_Ignore_Table: Tables specified for ignoring with the replicate_wild_ignore_table option.\n\nLast_Errno: Alias for Last_SQL_Errno (see below)\n\nLast_Error: Alias for Last_SQL_Error (see below)\n\nSkip_Counter: Number of events that a slave skips from the master, as recorded in the sql_slave_skip_counter system variable.\n\nExec_Master_Log_Pos: Position up to which the SQL thread has processed in the current master binary log file. Can be used to start a new slave from a current slave with the CHANGE MASTER TO ... MASTER_LOG_POS option.\n\nRelay_Log_Space: Total size of all relay log files combined.\n\nUntil_Condition: One of four possible values: None, Master, Relay, or Gtid, depending on the respective START SLAVE UNTIL condition.\n\nUntil_Log_File: The MASTER_LOG_FILE value of the START SLAVE UNTIL condition.\n\nUntil_Log_Pos: The MASTER_LOG_POS value of the START SLAVE UNTIL condition.\n\nMaster_SSL_Allowed: Whether an SSL connection is permitted (Yes), not permitted (No) or permitted but without the slave having SSL support enabled (Ignored)\n\nMaster_SSL_CA_File: The MASTER_SSL_CA option of the CHANGE MASTER TO statement.\n\nMaster_SSL_CA_Path: The MASTER_SSL_CAPATH option of the CHANGE MASTER TO statement.\n\nMaster_SSL_Cert: The MASTER_SSL_CERT option of the CHANGE MASTER TO statement.\n\nMaster_SSL_Cipher: The MASTER_SSL_CIPHER option of the CHANGE MASTER TO statement.\n\nMaster_SSL_Key: The MASTER_SSL_KEY option of the CHANGE MASTER TO statement.\n\nSeconds_Behind_Master: Difference between the timestamp logged on the master for the event that the slave is currently processing, and the current timestamp on the slave. Zero if the slave is not currently processing an event. With serial replication, seconds_behind_master is updated when the SQL thread begins executing a transaction. With parallel replication, seconds_behind_master is updated only after transactions commit. An exception is thrown on the parallel slave to additionally update seconds_behind_master when the first transaction received after idling is queued to a worker for execution, to provide a reliable initial value for the duration until a transaction commits.\n\nAdditional behavior to be aware of:\n\n1. Seconds_Behind_Master will update for ignored events, e.g. those skipped due to sql_slave_skip_counter.\n2. On the serial slave, transactions with prior timestamps can update Seconds_Behind_Master such that it can go backwards, though this is not true for the parallel slave.\n3. When configured with MASTER_DELAY, as a replicated transaction begins executing (i.e. on a serial or post-idle parallel slave), Seconds_Behind_Master will update before delaying, and while delaying occurs will grow to encompass the configured value.\n4. There is a known issue, tracked by MDEV-17516, such that Seconds_Behind_Master will initially present as 0 on slave restart until a replicated transaction begins executing, even if the last slave session was lagging behind when stopped.\n\nSeconds_Behind_Master: Difference between the timestamp logged on the master for the event that the slave is currently processing, and the current timestamp on the slave. Zero if the slave is not currently processing an event. With serial replication, seconds_behind_master is updated when the SQL thread begins executing a transaction. With parallel replication, seconds_behind_master is updated only after transactions commit.\n\nAdditional behavior to be aware of:\n\n1. Seconds_Behind_Master will update for ignored events, e.g. those skipped due to sql_slave_skip_counter.\n2. On the serial slave, transactions with prior timestamps can update Seconds_Behind_Master such that it can go backwards, though this is not true for the parallel slave.\n3. When configured with MASTER_DELAY, as a replicated transaction begins executing (i.e. on a serial or post-idle parallel slave), Seconds_Behind_Master will update before delaying, and while delaying occurs will grow to encompass the configured value.\n4. There is a known issue, tracked by MDEV-17516, such that Seconds_Behind_Master will initially present as 0 on slave restart until a replicated transaction begins executing, even if the last slave session was lagging behind when stopped.\n\nMaster_SSL_Verify_Server_Cert: The MASTER_SSL_VERIFY_SERVER_CERT option of the CHANGE MASTER TO statement.\n\nLast_IO_Errno: Error code of the most recent error that caused the I/O thread to stop (also recorded in the slave''s error log). 0 means no error. RESET SLAVE or RESET MASTER will reset this value.\n\nLast_IO_Error: Error message of the most recent error that caused the I/O thread to stop (also recorded in the slave''s error log). An empty string means no error. RESET SLAVE or RESET MASTER will reset this value.\n\nLast_SQL_Errno: Error code of the most recent error that caused the SQL thread to stop (also recorded in the slave''s error log). 0 means no error. RESET SLAVE or RESET MASTER will reset this value.\n\nLast_SQL_Error: Error message of the most recent error that caused the SQL thread to stop (also recorded in the slave''s error log). An empty string means no error. RESET SLAVE or RESET MASTER will reset this value.\n\nReplicate_Ignore_Server_Ids: List of server_ids that are currently being ignored for replication purposes, or an empty string for none, as specified in the IGNORE_SERVER_IDS option of the CHANGE MASTER TO statement.\n\nMaster_Server_Id: The master''s server_id value.\n\nMaster_SSL_Crl: The MASTER_SSL_CRL option of the CHANGE MASTER TO statement.\n\nMaster_SSL_Crlpath: The MASTER_SSL_CRLPATH option of the CHANGE MASTER TO statement.\n\nUsing_Gtid: Whether or not global transaction ID''s are being used for replication (can be No, Slave_Pos, or Current_Pos).\n\nGtid_IO_Pos: Current global transaction ID value.\n\nReplicate_Do_Domain_Ids: List of domain_ids that are currently being recognized for replication purposes, or an empty string for none, as specified in the DO_DOMAIN_IDS option of the CHANGE MASTER TO statement.\n\nReplicate_Ignore_Domain_Ids: List of domain_ids that are currently being ignored for replication purposes, or an empty string for none, as specified in the IGNORE_DOMAIN_IDS option of the CHANGE MASTER TO statement.\n\nParallel_Mode: The in-order parallel replication mode as configured by the slave_parallel_mode system variable.\n\nSQL_Delay: Value specified by MASTER_DELAY in CHANGE MASTER (or 0 if none).\n\nSQL_Remaining_Delay: When the slave is delaying the execution of an event due to MASTER_DELAY, this is the number of seconds of delay remaining before the event will be applied. Otherwise, the value is NULL.\n\nSlave_SQL_Running_State: The state of the SQL driver threads, same as in SHOW PROCESSLIST. When the slave is delaying the execution of an event due to MASTER_DELAY, this field displays: "Waiting until MASTER_DELAY seconds after master executed event".\n\nSlave_DDL_Groups: This status variable counts the occurrence of DDL statements. This is a slave-side counter for optimistic parallel replication.\n\nSlave_Non_Transactional_Groups: This status variable counts the occurrence of non-transactional event groups. This is a slave-side counter for optimistic parallel replication.\n\nSlave_Transactional_Groups: This status variable counts the occurrence of transactional event groups. This is a slave-side counter for optimistic parallel replication.\n\nReplicate_Rewrite_DB: Databases specified for replicating and rewriting with the replicate_rewrite_db system variable/option.\n\nReplica_Rewrite_DB is not available.\n\nRetried_transactions: The number of times that replicating transactions have been retried due to temporary errors (e.g. deadlocks in parallel replication). Returned with SHOW ALL SLAVES STATUS only.\n\nMax_relay_log_size: Max relay log size for this connection. Returned with SHOW ALL SLAVES STATUS only.\n\nExecuted_log_entries: Number of binary log events that have been executed, irrespective of error outcome (i.e. if the event execution results in an error, this number will still increase). Returned with SHOW ALL SLAVES STATUS only.\n\nSlave_received_heartbeats: Number of Heartbeat Log Events that the slave has received. Note this counter does not reset when the slave is restarted; only when a new CHANGE MASTER command has executed. Returned with SHOW ALL SLAVES STATUS only.\n\nSlave_heartbeat_period: Configured (by CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD) interval in seconds between replication heartbeats. Returned with SHOW ALL SLAVES STATUS only.\n\nGtid_Slave_Pos: The value of the global variable gtid_slave_pos, i.e. the GTID of the last event group replicated on a slave server, for each replication domain, as stored in the gtid_slave_pos system variable. Returned with SHOW ALL SLAVES STATUS only.\n\nMaster_last_event_time: Timestamp of the last event read from the master by the IO thread. NULL until the slave has started and the slave has read one query event from the master that changes data.\n\nSlave_last_event_time: Master timestamp of the last event committed on the slave. NULL until the slave has started and the slave has read one query event from the master that changes data.\n\nMaster_Slave_time_diff: The difference of the above two timestamps. NULL until the slave has started and the slave has read one query event from the master that changes data.\n\nMaster_last_event_time, Slave_last_event_time, and Master_Slave_time_diff are not available.\n\nConnects_Tried: The number of attempts done to connect to the master. It starts from 0 with _START_ SLAVE (but not STOP SLAVE), RESET SLAVE or CHANGE MASTER TO MASTER_RETRY_COUNT, and increments after each connection attempt until one succeeds or, after this reaches Master_Retry_Count, aborts the connection.\n\nMaster_Retry_Count: The limit to Connects_Tried as configured by CHANGE MASTER TO MASTER_RETRY_COUNT.\n\nConnects_Tried: and Master_Retry_Count: are not available. If the Performance Schema is enabled, replication_connection_configuration has CONNECTION_RETRY_COUNT available as an older alternative to Master_Retry_Count.\n\nExamples\n--------\n\nSHOW SLAVE STATUS\\G\n************************ 1. row ************************\n                Slave_IO_State: Waiting for master to send event\n                   Master_Host: db01.example.com\n                   Master_User: replicant\n                   Master_Port: 3306\n                 Connect_Retry: 60\n               Master_Log_File: mariadb-bin.000021\n           Read_Master_Log_Pos: 17315\n                Relay_Log_File: relay-bin.000042\n                 Relay_Log_Pos: 17446\n         Relay_Master_Log_File: mariadb-bin.000021\n              Slave_IO_Running: Yes\n             Slave_SQL_Running: Yes\n               Replicate_Do_DB: \n           Replicate_Ignore_DB: \n            Replicate_Do_Table: \n        Replicate_Ignore_Table: \n       Replicate_Wild_Do_Table: \n   Replicate_Wild_Ignore_Table: \n                    Last_Errno: 0\n                    Last_Error: \n                  Skip_Counter: 0\n           Exec_Master_Log_Pos: 17146\n               Relay_Log_Space: 17972\n               Until_Condition: None\n                Until_Log_File: \n                 Until_Log_Pos: 0\n            Master_SSL_Allowed: Yes\n            Master_SSL_CA_File: \n            Master_SSL_CA_Path:\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-replica-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (597, 26, 'SHOW STATUS', 'Syntax\n------\n\nSHOW [GLOBAL | SESSION] STATUS\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW STATUS provides server status information. This information also can be obtained using the mariadb-admin extended-status command, or by querying the Information Schema GLOBAL_STATUS and SESSION_STATUS tables. The LIKE clause, if present, indicates which variable names to match. The WHERE clause can be given to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for all connections to MariaDB. WithSESSION, it displays the status values for the current connection. If no modifier is present, the default isSESSION. LOCAL is a synonym forSESSION. If you see a lot of 0 values, the reason is probably that you have used SHOW STATUS with a new connection instead of SHOW GLOBAL STATUS.\n\nSome status variables have only a global value. For these, you get the same value for both GLOBAL and SESSION.\n\nSee Server Status Variables for a full list, scope and description of the variables that can be viewed with SHOW STATUS.\n\nThe LIKE clause, if present on its own, indicates which variable name to match.\n\nThe WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nSHOW GLOBAL STATUS;\n+--------------------------------------------------------------+----------------------------------------+\n| Variable_name                                                | Value                                  |\n+--------------------------------------------------------------+----------------------------------------+\n| Aborted_clients                                              | 0                                      |\n| Aborted_connects                                             | 0                                      |\n| Access_denied_errors                                         | 0                                      |\n| Acl_column_grants                                            | 0                                      |\n| Acl_database_grants                                          | 2                                      |\n| Acl_function_grants                                          | 0                                      |\n| Acl_procedure_grants                                         | 0                                      |\n| Acl_proxy_users                                              | 2                                      |\n| Acl_role_grants                                              | 0                                      |\n| Acl_roles                                                    | 0                                      |\n| Acl_table_grants                                             | 0                                      |\n| Acl_users                                                    | 6                                      |\n| Aria_pagecache_blocks_not_flushed                            | 0                                      |\n| Aria_pagecache_blocks_unused                                 | 15706                                  |\n...\n| wsrep_local_index                                            | 18446744073709551615                   |\n| wsrep_provider_name                                          |                                        |\n| wsrep_provider_vendor                                        |                                        |\n| wsrep_provider_version                                       |                                        |\n| wsrep_ready                                                  | OFF                                    |\n| wsrep_thread_count                                           | 0                                      |\n+--------------------------------------------------------------+----------------------------------------+\n516 rows in set (0.00 sec)\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (598, 26, 'SHOW TABLE\\_STATISTICS', 'Syntax\n------\n\nSHOW TABLE_STATISTICS\n\nDescription\n-----------\n\nThe SHOW TABLE_STATISTICS statement is part of the User Statistics feature. It was effectively replaced by the generic SHOW TABLE STATISTICS statement. The information_schema.TABLE_STATISTICS table shows statistics on table usage.\n\nThe SHOW TABLE_STATISTICS statement is part of the User Statistics feature. The information_schema.TABLE_STATISTICS table shows statistics on table usage.\n\nThe userstat system variable must be set to 1 to activate this feature. See the User Statistics and information_schema.TABLE_STATISTICS articles for more information.\n\nExamples\n--------\n\nSHOW TABLE_STATISTICS\\G\n************************ 1. row *********************\n           Table_schema: mysql\n             Table_name: proxies_priv\n              Rows_read: 2\n           Rows_changed: 0\nRows_changed_x_#indexes: 0\n********************* 2. row *********************\n           Table_schema: test\n             Table_name: employees_example\n              Rows_read: 7\n           Rows_changed: 0\nRows_changed_x_#indexes: 0\n********************* 3. row *********************\n           Table_schema: mysql\n             Table_name: user\n              Rows_read: 16\n           Rows_changed: 0\nRows_changed_x_#indexes: 0\n********************* 4. row ************************\n           Table_schema: mysql\n             Table_name: db\n              Rows_read: 2\n           Rows_changed: 0\nRows_changed_x_#indexes: 0\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-table-statistics', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-table-statistics');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (599, 26, 'SHOW TABLE STATUS', 'Syntax\n------\n\nSHOW TABLE STATUS [{FROM | IN} db_name]\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLE STATUS works like SHOW TABLES, but provides more extensive information about each table.\n\nSHOW TABLE STATUS works like SHOW TABLES, but provides more extensive information about each table. Only non-TEMPORARY tables are shown.\n\nThe LIKE clause, if present on its own, indicates which table names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n| Column             | Description                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Name               | Table name.                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| Engine             | Table storage engine.                                                                                                                                                                                                                                                                                                                                                                     |\n| Version            | Version number from the table''s .frm file.                                                                                                                                                                                                                                                                                                                                                                                             |\n| Row_format        | Row format (see InnoDB, Aria and MyISAM row formats).                                                                                                        |\n| Rows               | Number of rows in the table. Some engines, such as InnoDB may store an estimate.                                                                                                                                                                                                                                                                                                   |\n| Avg_row_length   | Average row length in the table.                                                                                                                                                                                                                                                                                                                                                                                                       |\n| Data_length       | For InnoDB, the index size, in pages, multiplied by the page size. For Aria and MyISAM, length of the data file, in bytes. For MEMORY, the approximate allocated memory.                 |\n| Max_data_length  | Maximum length of the data file, ie the total number of bytes that could be stored in the table. Not used in InnoDB.                                                                                                                                                                                                                                                               |\n| Index_length      | Length of the index file.                                                                                                                                                                                                                                                                                                                                                                                                              |\n| Data_free         | Bytes allocated but unused. For InnoDB tables in a shared tablespace, the free space of the shared tablespace with small safety margin. An estimate in the case of partitioned tables - see the PARTITIONS table.                                                                                                        |\n| Auto_increment    | Next AUTO_INCREMENT value.                                                                                                                                                                                                                                                                                                                                                                   |\n| Create_time       | Time the table was created. Some engines just return the ctime information from the file system layer here, in that case the value is not necessarily the table creation time but rather the time the file system metadata for it had last changed.                                                                                                                                                                                    |\n| Update_time       | Time the table was last updated. On Windows, the timestamp is not updated on update, so MyISAM values will be inaccurate. In InnoDB, if shared tablespaces are used, will be NULL, while buffering can also delay the update, so the value will differ from the actual time of the last UPDATE, INSERT or DELETE.                                                                  |\n| Check_time        | Time the table was last checked. Not kept by all storage engines, in which case will be NULL.                                                                                                                                                                                                                                                                                                                                          |\n| Collation          | Character set and collation.                                                                                                                                                                                                                                                                                                                                                  |\n| Checksum           | Live checksum value, if any.                                                                                                                                                                                                                                                                                                                                                                                                           |\n| Create_options    | Extra CREATE TABLE options.                                                                                                                                                                                                                                                                                                                                                            |\n| Comment            | Table comment provided when MariaDB created the table.                                                                                                                                                                                                                                                                                                                                                                                 |\n| Max_index_length | Maximum index length (supported by MyISAM and Aria tables).                                                                                                                                                                                                                                                                                                                                                                            |\n| Temporary          | Until MariaDB 11.2.0, placeholder to signal that a table is a temporary table and always "N", except "Y" for generated information_schema tables and NULL for views. From MariaDB 11.2.0, will also be set to "Y" for local temporary tables. |\n\nSimilar information can be found in the information_schema.TABLES table as well as by using mariadb-show:\n\n``bash\nmariadb-show --status db_name\n`\n\nViews\n\nFor views, all columns in SHOW TABLE STATUS are NULL` except ''Name'' and ''Comment''\n\nExamples\n--------\n\nSHOW TABLE STATUS\\G\n************************ 1. row ************************\n           Name: bus_routes\n         Engine: InnoDB\n        Version: 10\n     Row_format: Dynamic\n           Rows: 5\n Avg_row_length: 3276\n    Data_length: 16384\nMax_data_length: 0\n   Index_length: 0\n      Data_free: 0\n Auto_increment: NULL\n    Create_time: 2017-05-24 11:17:46\n    Update_time: NULL\n     Check_time: NULL\n      Collation: latin1_swedish_ci\n       Checksum: NULL\n Create_options: \n        Comment:\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-table-status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-table-status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (600, 26, 'SHOW TABLES', 'Syntax\n------\n\nSHOW [FULL] TABLES [FROM db_name]\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLES lists the tables, sequences and views in a given database.\n\nSHOW TABLES lists the tables (only non-TEMPORARY tables are shown), sequences and views in a given database.\n\nThe LIKE clause, if present on its own, indicates which table names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW. For example, when searching for tables in the test database, the column name for use in the WHERE and LIKE clauses will be Tables_in_test\n\nThe FULL modifier is supported such that SHOW FULL TABLES displays a second output column. Values for the second column, Table_type, are BASE TABLE for a table, VIEW for a view and SEQUENCE for a sequence.\n\nYou can also get this information using:\n\n``bash\nmariadb-show db_name\n`\n\nSee mariadb-show for more details.\n\nIf you have no privileges for a base table or view, it does not show up in the output from SHOW TABLES or mariadb-show db_name`.\n\nThe information_schema.TABLES table, as well as the SHOW TABLE STATUS statement, provide extended information about tables.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n| t1                   |\n| view1                |\n+----------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-tables', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-tables');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (601, 26, 'SHOW TRIGGERS', 'Syntax\n------\n\nSHOW TRIGGERS [FROM db_name]\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a database (the default database unless a FROM clause is given). This statement requires the TRIGGER privilege.\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a database (the default database unless a FROM clause is given). This statement requires the SUPER privilege.\n\nThe LIKE clause, if present on its own, indicates which table names to match and causes the statement to display triggers for those tables. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nSimilar information is stored in the information_schema.TRIGGERS table.\n\nIf there are multiple triggers for the same action, then the triggers are shown in action order.\n\nExamples\n--------\n\nSHOW triggers Like ''animals'' \\G\n************************ 1. row ************************\n             Trigger: the_mooses_are_loose\n               Event: INSERT\n               Table: animals\n           Statement: BEGIN\n IF NEW.name = ''Moose'' THEN\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n              Timing: AFTER\n             Created: 2016-09-29 13:53:34.35\n            sql_mode: \n             Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-triggers', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-triggers');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (602, 26, 'SHOW USER\\_STATISTICS', 'Syntax\n------\n\nSHOW USER_STATISTICS\n\nDescription\n-----------\n\nThe SHOW USER_STATISTICS statement is part of the User Statistics feature. It was effectively replaced by the generic SHOW information_schema_table statement. The information_schema.USER_STATISTICS table holds statistics about user activity. You can use this table to find out such things as which user is causing the most load and which users are being abusive. You can also use this table to measure how close to capacity the server may be.\n\nThe SHOW USER_STATISTICS statement is part of the User Statistics feature. The information_schema.USER_STATISTICS table holds statistics about user activity. You can use this table to find out such things as which user is causing the most load and which users are being abusive. You can also use this table to measure how close to capacity the server may be.\n\nThe userstat system variable must be set to 1 to activate this feature. See the User Statistics and information_schema.USER_STATISTICS table for more information.\n\nExamples\n--------\n\nSHOW USER_STATISTICS\\G\n************************ 1. row ************************\n                  User: root\n     Total_connections: 1\nConcurrent_connections: 0\n        Connected_time: 3297\n             Busy_time: 0.14113400000000006\n              Cpu_time: 0.017637000000000003\n        Bytes_received: 969\n            Bytes_sent: 22355\n  Binlog_bytes_written: 0\n             Rows_read: 10\n             Rows_sent: 67\n          Rows_deleted: 0\n         Rows_inserted: 0\n          Rows_updated: 0\n       Select_commands: 7\n       Update_commands: 0\n        Other_commands: 0\n   Commit_transactions: 1\n Rollback_transactions: 0\n    Denied_connections: 0\n      Lost_connections: 0\n         Access_denied: 0\n         Empty_queries: 7\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-user-statistics', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-user-statistics');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (603, 26, 'SHOW USER\\_VARIABLES', 'Description\n-----------\n\nSee the User Variables Plugin for details.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-user_variables', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-user_variables');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (604, 26, 'SHOW VARIABLES', 'Syntax\n------\n\nSHOW [GLOBAL | SESSION] VARIABLES\n    [LIKE ''pattern'' | WHERE expr]\n\nDescription\n-----------\n\nSHOW VARIABLES shows the values of MariaDB system variables. This does not include user-defined variables - see here for details on viewing those.\n\nSystem variable information can also be obtained using the mariadb-admin variables command. The LIKE clause, if present, indicates which variable names to match. The WHERE clause can be given to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are used for new connections to MariaDB. With SESSION, it displays the values that are in effect for the current connection. If no modifier is present, the default is SESSION. LOCAL is a synonym for SESSION. With a LIKE clause, the statement displays only rows for those variables with names that match the pattern. To obtain the row for a specific variable, use a LIKE clause as shown:\n\n``sql\nSHOW VARIABLES LIKE ''maria_group_commit'';\nSHOW SESSION VARIABLES LIKE ''maria_group_commit'';\n`\n\nTo get a list of variables whose name match a pattern, use the "%" wildcard character in a LIKE clause:\n\n`sql\nSHOW VARIABLES LIKE ''%maria%'';\nSHOW GLOBAL VARIABLES LIKE ''%maria%'';\n`\n\nWildcard characters can be used in any position within the pattern to be matched. Strictly speaking, because "_" is a wildcard that matches any single character, you should escape it as "_" to match it literally. In practice, this is rarely necessary.\n\nThe WHERE and LIKE` clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nSee SET for information on setting server system variables.\n\nSee Server System Variables for a list of all the variables that can be set.\n\nYou can also see the server variables by querying the Information Schema GLOBAL_VARIABLES and SESSION_VARIABLES tables.\n\nExamples\n--------\n\nSHOW VARIABLES LIKE ''aria%'';\n+------------------------------------------+---------------------+\n| Variable_name                            | Value               |\n+------------------------------------------+---------------------+\n| aria_block_size                          | 8192                |\n| aria_checkpoint_interval                 | 30                  |\n| aria_checkpoint_log_activity             | 1048576             |\n| aria_force_start_after_recovery_failures | 0                   |\n| aria_group_commit                        | none                |\n| aria_group_commit_interval               | 0                   |\n| aria_log_file_size                       | 1073741824          |\n| aria_log_purge_type                      | immediate           |\n| aria_max_sort_file_size                  | 9223372036853727232 |\n| aria_page_checksum                       | ON                  |\n| aria_pagecache_age_threshold             | 300                 |\n| aria_pagecache_buffer_size               | 134217728           |\n| aria_pagecache_division_limit            | 100                 |\n| aria_recover                             | NORMAL              |\n| aria_repair_threads                      | 1                   |\n| aria_sort_buffer_size                    | 134217728           |\n| aria_stats_method                        | nulls_unequal       |\n| aria_sync_log_dir                        | NEWFILE             |\n| aria_used_for_temp_tables                | ON                  |\n+------------------------------------------+---------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-variables', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-variables');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (605, 26, 'SHOW WARNINGS', 'Syntax\n------\n\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT() WARNINGS\n\nDescription\n-----------\n\nSHOW WARNINGS shows the error, warning, and note messages that resulted from the last statement that generated messages in the current session. It shows nothing if the last statement used a table and generated no messages. (That is, a statement that uses a table but generates no messages clears the message list.) Statements that do not use tables and do not generate messages have no effect on the message list.\n\nA note is different to a warning in that it only appears if the sql_notes variable is set to 1 (the default), and is not converted to an error if strict mode is enabled.\n\nA related statement, SHOW ERRORS, shows only the errors.\n\nThe SHOW COUNT() WARNINGS statement displays the total number of errors, warnings, and notes. You can also retrieve this number from the warning_count variable:\n\n``sql\nSHOW COUNT() WARNINGS;\nSELECT @@warning_count;\n`\n\nThe value of warning_count might be greater than the number of messages displayed by SHOW WARNINGS if the max_error_count system variable is set so low that not all messages are stored.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nSHOW WARNINGS can be used after EXPLAIN EXTENDED to see how a query is internally rewritten by MariaDB.\n\nIf the sql_notes server variable is set to 1, Notes are included in the output of SHOW WARNINGS; if it is set to 0, this statement will not show (or count) Notes.\n\nThe results of SHOW WARNINGS and SHOW COUNT() WARNINGS are directly sent to the client. If you need to access those information in a stored program, you can use the GET DIAGNOSTICS statement instead.\n\nThe mariadb client also has a number of options related to warnings. The \\W command will show warnings after every statement, while \\w will disable this. Starting the client with the --show-warnings option will show warnings after every statement.\n\nMariaDB implements a stored routine error stack trace. SHOW WARNINGS` can also be used to show more information. See the example below.\n\nExamples\n--------\n\nSELECT 1/0;\n+------+\n| 1/0  |\n+------+\n| NULL |\n+------+\n\nSHOW COUNT(*) WARNINGS;\n+-------------------------+\n| @@session.warning_count |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSHOW WARNINGS;\n+---------+------+---------------+\n| Level   | Code | Message       |\n+---------+------+---------------+\n| Warning | 1365 | Division by 0 |\n+---------+------+---------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-warnings', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-warnings');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (606, 26, 'SHOW WSREP\\_MEMBERSHIP', 'Syntax\n------\n\nSHOW WSREP_MEMBERSHIP\n\nDescription\n-----------\n\nThe SHOW WSREP_MEMBERSHIP statement returns Galera node cluster membership information. It returns the same information as found in the information_schema.WSREP_MEMBERSHIP table. Only users with the SUPER privilege can access this information.\n\nExamples\n--------\n\nSHOW WSREP_MEMBERSHIP;\n+-------+--------------------------------------+----------+-----------------+\n| Index | Uuid                                 | Name     | Address         |\n+-------+--------------------------------------+----------+-----------------+\n|     0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 |\n|     1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 |\n|     2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 |\n+-------+--------------------------------------+----------+-----------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-wsrep_membership', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-wsrep_membership');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (607, 26, 'SHOW WSREP\\_STATUS', 'Syntax\n------\n\nSHOW WSREP_STATUS\n\nDescription\n-----------\n\nThe SHOW WSREP_STATUS statement returns Galera node and cluster status information. It returns the same information as found in the information_schema.WSREP_STATUS table. Only users with the SUPER privilege can access this information.\n\nExamples\n--------\n\nSHOW WSREP_STATUS;\n+------------+-------------+----------------+--------------+\n| Node_Index | Node_Status | Cluster_Status | Cluster_Size |\n+------------+-------------+----------------+--------------+\n|          0 | Synced      | Primary        |            3 |\n+------------+-------------+----------------+--------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-wsrep_status', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-wsrep_status');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (608, 26, 'SHUTDOWN', 'Syntax\n------\n\nSHUTDOWN [WAIT FOR ALL { SLAVES | REPLICAS } ]\n\nDescription\n-----------\n\nThe SHUTDOWN command shuts the server down.\n\nWAIT FOR ALL SLAVES / REPLICAS\n\nThe WAIT FOR ALL REPLICAS statement can be used throughout.\n\nThe WAIT FOR ALL SLAVES option was first added in MariaDB 10.4.4.\n\nWhen a master server is shutdown and it goes through the normal shutdown process, the master kills client threads in random order. By default, the master also considers its binary log dump threads to be regular client threads. As a consequence, the binary log dump threads can be killed while client threads still exist, and this means that data can be written on the master during a normal shutdown that won''t be replicated. This is true even if semi-synchronous replication is being used.\n\nThis problem can be solved by shutting down the server with the SHUTDOWN command and by providing the WAIT FOR ALL SLAVES/WAIT FOR ALL REPLICAS option to the command. For example:\n\n``sql\nSHUTDOWN WAIT FOR ALL SLAVES;\n`\n\nWhen the WAIT FOR ALL SLAVES option is provided, the server only kills its binary log dump threads after all client threads have been killed, and it only completes the shutdown after the last binary log has been sent to all connected slaves.\n\nSee Replication Threads: Binary Log Dump Threads and the Shutdown Process for more information.\n\nRequired Permissions\n\nOne must have a SHUTDOWN privilege (see GRANT) to use this command. It is the same privilege one needs to use the mariadb-admin shutdown command.\n\nShutdown for Upgrades\n\nIf you are doing a shutdown to migrate to another major version of MariaDB, please ensure that the innodb_fast_shutdown variable is not 2 (fast crash shutdown). The default of this variable is 1.\n\nExamples\n--------\n\nCREATE EVENT test.shutd`\n    ON SCHEDULE\n        EVERY 1 DAY\n        STARTS ''2014-01-01 20:00:00''\n    COMMENT ''Shutdown Maria when the office is closed''\nDO BEGIN\n    SHUTDOWN;\nEND;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/shutdown', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/shutdown');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (609, 26, 'USE \\[DATABASE]', 'Syntax\n------\n\nUSE db_name\n\nDescription\n-----------\n\nThe ''USE db_name'' statement tells MariaDB to use the db_name database as the default (current) database for subsequent statements. The database remains the default until the end of the session, or until another USE statement is issued:\n\n``sql\nUSE db1;\nSELECT COUNT() FROM mytable;   # selects FROM db1.mytable\nUSE db2;\nSELECT COUNT() FROM mytable;   # selects FROM db2.mytable\n`\n\nThe DATABASE() function (SCHEMA() is a synonym) returns the default database.\n\nAnother way to set the default database is by specifying its name when starting the mariadb command line client:\n\n`\nmariadb db1    # starts the mariadb command-line client with db1 as the current database\n`\n\nOne cannot use USE` to a database one has no privileges to. The reason is that a user with no privileges to a database should not be able to know if a database exists or not.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/use-database', '', 'https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/use-database');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (610, 35, 'Comment Syntax', 'Description\n-----------\n\nThere are three supported comment styles in MariaDB:\n\n1. From a hash sign (#) to the end of a line:\n\n``sql\nSELECT  FROM users; \n\nThis is a comment\n\n`\n\n1. From a double dash (--) to the end of a line. The space after the two dashes is required (as in MySQL).\n\n`sql\nSELECT  FROM users; -- This is a comment\n`\n\n1. C style comments from an opening ''/'' to a closing ''/''. Comments of this form can span multiple lines:\n\n`sql\nSELECT  FROM users; / This is a\nmulti-line\ncomment /\n`\n\nNested comments are possible in some situations, but they are not supported or recommended.\n\nExecutable Comments\n\nAs an aid to portability between different databases, MariaDB supports executable comments. These special comments allow you to embed SQL code which will not execute when run on other databases, but will execute when run on MariaDB.\n\nMariaDB supports both MySQL''s executable comment format, and a slightly modified version specific to MariaDB. This way, if you have SQL code that works on MySQL and MariaDB, but not other databases, you can wrap it in a MySQL executable comment, and if you have code that specifically takes advantage of features only available in MariaDB you can use the MariaDB specific format to\\\nhide the code from MySQL.\n\nExecutable Comment Syntax\n\nMySQL and MariaDB executable comment syntax:\n\n`sql\n/! MySQL or MariaDB-specific code /\n`\n\nCode that should be executed only starting from a specific MySQL or MariaDB version:\n\n`sql\n/!##### MySQL or MariaDB-specific code /\n`\n\nThe numbers, represented by ''######'' in the syntax examples above specify the specific the minimum versions of MySQL and MariaDB that should execute the comment. The first number is the major version, the second 2 numbers are the minor version and the last 2 is the patch level.\n\nFor example, if you want to embed some code that should only execute on MySQL or MariaDB starting from 5.1.0, you would do the following:\n\n`sql\n/!50100 MySQL and MariaDB 5.1.0 (and above) code goes here. /\n`\n\nMariaDB-only executable comment syntax (starting from MariaDB 5.3.1):\n\n`sql\n/M! MariaDB-specific code /\n/M!###### MariaDB-specific code /\n`\n\nMariaDB ignores MySQL-style executable comments that have a version number in the range 50700..99999. This is needed to skip features introduced in MySQL-5.7 that are not ported to MariaDB 10.x yet.\n\n`sql\n/!50701 MariaDB-10.x ignores MySQL-5.7 specific code /\n`\n\nNote: comments which have a version number in the range 50700..99999 that use MariaDB-style executable comment syntax are still executed.\n\n`sql\n/M!50701 MariaDB-10.x does not ignore this /\n``\n\nStatement delimiters cannot be used within executable comments.\n\nExamples\n--------\n\nSELECT 2 / +1 /;\nSELECT 1 /! +1 /;\nSELECT 1 /!50101 +1 /;\nSELECT 2 /M! +1 /;\nSELECT 2 /M!50301 +1 */;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/comment-syntax', '', 'https://mariadb.com/docs/server/reference/sql-statements/comment-syntax');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (611, 39, 'ALTER DATABASE', 'Syntax\n------\n\nALTER {DATABASE | SCHEMA} [db_name]\n    alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n    UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n    [DEFAULT] CHARACTER SET [=] charset_name\n  | [DEFAULT] COLLATE [=] collation_name\n  | COMMENT [=] ''comment''\n\nDescription\n-----------\n\nALTER DATABASE enables you to change the overall characteristics of a database. These characteristics are stored in the db.opt file in the database directory. To use ALTER DATABASE, you need the ALTER privilege on the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe CHARACTER SET clause changes the default database character set. The COLLATE clause changes the default database collation. See Character Sets and Collations for more.\n\nYou can see what character sets and collations are available using, respectively, the SHOW CHARACTER SET and SHOW COLLATION statements.\n\nChanging the default character set/collation of a database does not change the character set/collation of any stored procedures or stored functions that were previously created, and relied on the defaults. These need to be dropped and recreated in order to apply the character set/collation changes.\n\nThe database name can be omitted from the first syntax, in which case the statement applies to the default database.\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause. It updates the name of the directory associated with the database to use the encoding implemented in MySQL for mapping database names to database directory names (see Identifier to File Name Mapping). This clause is for use under these conditions:\n\n It is intended when upgrading MySQL from older versions.\n It is intended to update a database directory name to the current encoding format if the name contains special characters that need encoding.\n* The statement is used by mariadb-check (as invoked by mariadb-upgrade).\n\nFor example, if a database in MySQL 5.0 has a name of a-b-c, the name contains instance of the \\-'' character. In 5.0, the database directory is also named a-b-c, which is not necessarily safe for all file systems. In MySQL, the same database name is encoded as a@002db@002dc to produce a file-system-neutral directory name.\n\nWhen a MySQL installation is upgraded from an older version, the server displays a name such as a-b-c (which is in the old format) as #mysql50#a-b-c, and you must refer to the name using the #mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to explicitly tell the server to re-encode the database directory name to the current encoding format:\n\n`sql\nALTER DATABASE #mysql50#a-b-c UPGRADE DATA DIRECTORY NAME;\n`\n\nAfter executing this statement, you can refer to the database as a-b-c without the special #mysql50` prefix.\n\nMariaDB starting with 10.5.0\n\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024 bytes. If the comment length exceeds this length, a error/warning code 4144 is thrown. The database comment is also added to the db.opt file, as well as to the information_schema.schemata table.\n\nExamples\n--------\n\nALTER DATABASE p COMMENT=''Presentations'';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-database', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-database');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (612, 39, 'ALTER FUNCTION', 'Syntax\n------\n\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n    { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n  | COMMENT ''string''\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored function. More than one change may be specified in an ALTER FUNCTION statement. However, you cannot change the parameters or body of a stored function using this statement; to make such changes, you must drop and re-create the function using DROP FUNCTION and CREATE FUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That privilege is granted automatically to the function creator.) If binary logging is enabled, the ALTER FUNCTION statement might also require\\\nthe SUPER privilege, as described in Binary Logging of Stored Routines.\n\nExamples\n--------\n\nALTER FUNCTION hello SQL SECURITY INVOKER;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-function', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-function');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (613, 39, 'ALTER LOGFILE GROUP', 'Description\n-----------\n\nThe ALTER LOGFILE GROUP statement is not supported by MariaDB. It was originally inherited from MySQL NDB Cluster. See MDEV-19295 for more information.\n\nSyntax\n\n``sql\nALTER LOGFILE GROUP logfile_group\n    ADD UNDOFILE ''file_name''\n    [INITIAL_SIZE [=] size]\n    [WAIT]\n    ENGINE [=] engine_name\n``\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-logfile-group', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-logfile-group');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (614, 39, 'ALTER SERVER', 'Syntax\n------\n\nALTER SERVER server_name\n    OPTIONS (option [, option] ...)\n\nDescription\n-----------\n\nAlters the server information for _server_name_, adjusting the specified options as per the CREATE SERVER command. The corresponding fields in the mysql.servers table are updated accordingly. This statement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED ADMIN privilege.\n\nALTER SERVER is not written to the binary log, irrespective of the binary log format being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER, ALTER SERVER and DROP SERVER statements.\n\nExamples\n--------\n\nALTER SERVER s OPTIONS (USER ''sally'');\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-server', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-server');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (615, 39, 'ALTER TABLE', 'Syntax\n------\n\nALTER [ONLINE] [IGNORE] TABLE [IF EXISTS] tbl_name\n    [WAIT n | NOWAIT]\n    alter_specification [, alter_specification] ...\n\nalter_specification:\n    table_option ...\n  | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition\n        [FIRST | AFTER col_name ]\n  | ADD [COLUMN] [IF NOT EXISTS] (col_name column_definition, ...)\n  | ADD {INDEX|KEY} [IF NOT EXISTS] [index_name]\n        [index_type] (index_col_name,...) [index_option] ...\n  | ADD [CONSTRAINT [symbol]] PRIMARY KEY [IF NOT EXISTS]\n        [index_type] (index_col_name,...) [index_option] ...\n  | ADD [CONSTRAINT [symbol]]\n        UNIQUE [INDEX|KEY] [IF NOT EXISTS] [index_name]\n        [index_type] (index_col_name,...) [index_option] ...\n  | ADD FULLTEXT [INDEX|KEY] [IF NOT EXISTS [index_name]\n        (index_col_name,...) [index_option] ...\n  | ADD SPATIAL [INDEX|KEY] [IF NOT EXISTS [index_name]\n        (index_col_name,...) [index_option] ...\n  | ADD VECTOR [INDEX|KEY] [IF NOT EXISTS [index_name]\n        (index_col_name,...) [index_option] ...\n  | ADD [CONSTRAINT [symbol]]\n        FOREIGN KEY [IF NOT EXISTS] [index_name] (index_col_name,...)\n        reference_definition\n  | ADD PERIOD FOR [time_period_name|SYSTEM_TIME] (start_column_name, end_column_name)\n  | ALTER [COLUMN] col_name SET DEFAULT literal | (expression)\n  | ALTER [COLUMN] col_name DROP DEFAULT\n  | ALTER {INDEX|KEY} [IF EXISTS] index_name [NOT] IGNORED\n  | CHANGE [COLUMN] [IF EXISTS] old_col_name new_col_name column_definition\n        [FIRST|AFTER col_name]\n  | MODIFY [COLUMN] [IF EXISTS] col_name column_definition\n        [FIRST | AFTER col_name]\n  | DROP [COLUMN] [IF EXISTS] col_name [RESTRICT|CASCADE]\n  | DROP [CONSTRAINT] PRIMARY KEY\n  | DROP {INDEX|KEY} [IF EXISTS] index_name\n  | DROP FOREIGN KEY [IF EXISTS] fk_symbol\n  | DROP CONSTRAINT [IF EXISTS] constraint_name\n  | DISABLE KEYS\n  | ENABLE KEYS\n  | RENAME [TO] new_tbl_name\n  | ORDER BY col_name [, col_name] ...\n  | RENAME COLUMN [IF EXISTS] old_col_name TO new_col_name\n  | RENAME {INDEX|KEY} old_index_name TO new_index_name\n  | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n  | [DEFAULT] CHARACTER SET [=] charset_name\n  | [DEFAULT] COLLATE [=] collation_name\n  | DISCARD TABLESPACE\n  | IMPORT TABLESPACE\n  | ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n  | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n  | FORCE\n  | partition_options\n  | CONVERT TABLE normal_table TO partition_definition [{WITH | WITHOUT} VALIDATION]\n  | CONVERT PARTITION partition_name TO TABLE tbl_name\n  | ADD PARTITION [IF NOT EXISTS] (partition_definition)\n  | DROP PARTITION [IF EXISTS] partition_names\n  | TRUNCATE PARTITION partition_names\n  | COALESCE PARTITION number\n  | REORGANIZE PARTITION [partition_names INTO (partition_definitions)]\n  | ANALYZE PARTITION partition_names\n  | CHECK PARTITION partition_names\n  | OPTIMIZE PARTITION partition_names\n  | REBUILD PARTITION partition_names\n  | REPAIR PARTITION partition_names\n  | EXCHANGE PARTITION partition_name WITH TABLE tbl_name [{WITH | WITHOUT} VALIDATION]\n  | REMOVE PARTITIONING\n  | ADD SYSTEM VERSIONING\n  | DROP SYSTEM VERSIONING\n\nindex_col_name:\n    col_name [(length)] [ASC | DESC]\n\nindex_type:\n    USING {BTREE | HASH | RTREE}\n\nindex_option:\n    KEY_BLOCK_SIZE [=] value\n  | index_type\n  | WITH PARSER parser_name\n  | VISIBLE\n  | COMMENT ''string''\n  | CLUSTERING={YES | NO}\n  | { IGNORED | NOT IGNORED }\n  | DISTANCE={EUCLIDEAN | COSINE}\n  | M=number\n\n  table_option [[,] table_option] ...\n\nDescription\n-----------\n\nALTER TABLE enables you to change the structure of an existing table. For example, you can add or delete columns, create or destroy indexes, change the type of existing columns, or rename columns or the table itself. You can also change the comment for the table and the storage engine of the table.\n\nIf another connection is using the table, a metadata lock is active, and this statement will wait until the lock is released. This is also true for non-transactional tables.\n\nWhen adding a UNIQUE index on a column (or a set of columns) which have duplicated values, an error will be produced and the statement will be stopped. To suppress the error and force the creation of UNIQUE indexes, discarding duplicates, the IGNORE option can be specified. This can be useful if a column (or a set of columns) should be UNIQUE but it contains duplicate values; however, this technique provides no control on which rows are preserved and which are deleted. Also, note that IGNORE is accepted but ignored in ALTER TABLE ... EXCHANGE PARTITION statements.\n\nThis statement can also be used to rename a table. For details see RENAME TABLE.\n\nWhen an index is created, the storage engine may use a configurable buffer in the process. Incrementing the buffer speeds up the index creation. Aria and MyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or myisam_sort_buffer_size, also used for REPAIR TABLE. InnoDB allocates three buffers whose size is defined by innodb_sort_buffer_size.\n\nPrivileges\n\nExecuting the ALTER TABLE statement generally requires at least the ALTER privilege for the table or the database. If you are renaming a table, this also requires the DROP, CREATE and INSERT privileges for the table or the database.\n\nOnline DDL\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nALTER ONLINE TABLE\n\nALTER ONLINE TABLE also works for partitioned tables.\n\nALTER ONLINE TABLE ... is equivalent to the ALTER TABLE ... LOCK = NONE.\n\nSee the LOCK alter specification for more information.\n\nWAIT/NOWAIT\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nIF EXISTS\n\nThe IF EXISTS and IF NOT EXISTS clauses are available for the following clauses:\n\n``sql\nADD COLUMN       [IF NOT EXISTS]\nADD INDEX        [IF NOT EXISTS]\nADD FOREIGN KEY  [IF NOT EXISTS]\nADD PARTITION    [IF NOT EXISTS]\nCREATE INDEX     [IF NOT EXISTS]\nDROP COLUMN      [IF EXISTS]\nDROP INDEX       [IF EXISTS]\nDROP FOREIGN KEY [IF EXISTS]\nDROP PARTITION   [IF EXISTS]\nCHANGE COLUMN    [IF EXISTS]\nMODIFY COLUMN    [IF EXISTS]\nDROP INDEX       [IF EXISTS]\n`\n\nWhen IF EXISTS and IF NOT EXISTS are used in clauses, queries will not report errors when the condition is triggered for that clause. A warning with the same message text will be issued and the ALTER will move on to the next clause in the statement (or end if finished).\n\nIf this is directive is used after ALTER ... TABLE, you don''t get an error if the table doesn''t exist. Example:\n\n`sql\nCREATE TABLE t (i INT);\nALTER TABLE IF EXISTS t RENAME COLUMN IF EXISTS i TO k;\n`\n\nColumn Definitions\n\nSee CREATE TABLE: Column Definitions for information about column definitions.\n\nIndex Definitions\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nThe CREATE INDEX and DROP INDEX statements can also be used to add or remove an index.\n\nCharacter Sets and Collations\n\n`sql\nCONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n[DEFAULT] CHARACTER SET [=] charset_name\n[DEFAULT] COLLATE [=] collation_name\n`\n\nSee Setting Character Sets and Collations for details on setting the character sets and collations.\n\nAlter Specifications\n\nTable Options\n\nSee CREATE TABLE: Table Options for information about table options.\n\nADD COLUMN\n\n`sql\n... ADD COLUMN [IF NOT EXISTS]  (col_name column_definition,...)\n`\n\nAdds a column to the table. The syntax is the same as in CREATE TABLE. If you are using IF NOT_EXISTS the column will not be added if it was not there already. This is very useful when doing scripts to modify tables.\n\nThe FIRST and AFTER clauses affect the physical order of columns in the datafile. Use FIRST to add a column in the first (leftmost) position, or AFTER followed by a column name to add the new column in any other position. Note that, nowadays, the physical position of a column is usually irrelevant.\n\nSee also Instant ADD COLUMN for InnoDB.\n\nDROP COLUMN\n\n`sql\n... DROP COLUMN [IF EXISTS] col_name [CASCADE|RESTRICT]\n`\n\nDrops the column from the table. If you are using IF EXISTS you will not get an error if the column didn''t exist. If the column is part of any index, the column will be dropped from them, except if you add a new column with identical name at the same time. The index will be dropped if all columns from the index were dropped. If the column was used in a view or trigger, you will get an error next time the view or trigger is accessed. Dropping a column that is part of a multi-column UNIQUE constraint is not permitted. For example:\n\n`sql\nCREATE TABLE a (\n  a int,\n  b int,\n  primary key (a,b)\n);\n\nALTER TABLE x DROP COLUMN a;\n[42000][1072] Key column ''A'' doesn''t exist in table\n`\n\nThe reason is that dropping column a would result in the new constraint that all values in column b be unique. In order to drop the column, an explicit DROP PRIMARY KEY and ADD PRIMARY KEY would be required.\n\nMariaDB supports instant DROP COLUMN. DROP COLUMN of an indexed column would imply DROP INDEX (and in the case of a non-UNIQUE multi-column index, possibly ADD INDEX). These will not be allowed with ALGORITHM=INSTANT, but unlike prior versions, they can be allowed with ALGORITHM=NOCOPY\n\nRESTRICT and CASCADE are allowed to make porting from other database systems easier. In MariaDB, they do nothing.\n\nMODIFY COLUMN\n\nAllows you to modify the type of a column. The column will be at the same place as the original column and all indexes on the column will be kept. Note that when modifying column, you should specify all attributes for the new column.\n\n`sql\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY((a));\nALTER TABLE t1 MODIFY a BIGINT UNSIGNED AUTO_INCREMENT;\n`\n\nCHANGE COLUMN\n\nWorks like MODIFY COLUMN except that you can also change the name of the column. The column will be at the same place as the original column and all index on the column will be kept.\n\n`sql\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a));\nALTER TABLE t1 CHANGE a b BIGINT UNSIGNED AUTO_INCREMENT;\n`\n\nALTER COLUMN\n\nThis lets you change column options.\n\n`sql\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, b varchar(50), PRIMARY KEY(a));\nALTER TABLE t1 ALTER b SET DEFAULT ''hello'';\n`\n\nRENAME INDEX/KEY\n\nYou can rename an index using the RENAME INDEX (or RENAME KEY) syntax:\n\n`sql\nALTER TABLE t1 RENAME INDEX i_old TO i_new;\n`\n\nRENAME INDEX/KEY is not available.\n\nRENAME COLUMN\n\nYou can rename a column using the RENAME COLUMN syntax:\n\n`sql\nALTER TABLE t1 RENAME COLUMN c_old TO c_new;\n`\n\nRENAME COLUMN is not available.\n\nADD PRIMARY KEY\n\nAdds a primary key. For PRIMARY KEY indexes, you can specify a name for the index, but it is silently ignored, and the name of the index is always PRIMARY. See Getting Started with Indexes: Primary Key for more information.\n\nDROP PRIMARY KEY\n\nDrops a primary key. For PRIMARY KEY indexes, you can specify a name for the index, but it is silently ignored, and the name of the index is always PRIMARY. See Getting Started with Indexes: Primary Key for more information.\n\nADD FOREIGN KEY\n\nAdds a foreign key. For FOREIGN KEY indexes, a reference definition must be provided. For FOREIGN KEY indexes, you can specify a name for the constraint, using the CONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column or a column list which must be indexed and whose values must match to the foreign key''s values. The MATCH clause is accepted to improve the compatibility with other DBMS''s, but has no meaning in MariaDB. The ON DELETE and ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE) statements attempts to delete a referenced row from the parent table, and when an UPDATE statement attempts to modify the referenced foreign key columns in a parent table row, respectively. The following options are allowed:\n\n RESTRICT: The delete/update operation is not performed. The statement terminates with a 1451 error (SQLSTATE ''2300'').\n NO ACTION: Synonym for RESTRICT.\n CASCADE: The delete/update operation is performed in both tables.\n SET NULL: The update or delete goes ahead in the parent table, and the corresponding foreign key fields in the child table are set to NULL. (They must not be defined as NOT NULL for this to succeed).\n SET DEFAULT: This option is implemented only for the legacy PBXT storage engine, which is disabled by default and no longer maintained. It sets the child table''s foreign key fields to their DEFAULT values when the referenced parent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is RESTRICT.\n\nSee Foreign Keys for more information.\n\nDROP FOREIGN KEY\n\nDrops a foreign key. See Foreign Keys for more information.\n\nADD INDEX\n\nAdds a plain index. Plain indexes are regular indexes that are not unique, and are not acting as a primary key or a foreign key. They are also not the "specialized" FULLTEXT or SPATIAL indexes. For limits on InnoDB indexes, see InnoDB Limitations. See Getting Started with Indexes: Plain Indexes for more information.\n\nDROP INDEX\n\nDrops a plain index. Plain indexes are regular indexes that are not unique, and are not acting as a primary key or a foreign key. They are also not the "specialized" FULLTEXT or SPATIAL indexes. See Getting Started with Indexes: Plain Indexes for more information.\n\nADD UNIQUE INDEX\n\nAdds a unique index. The UNIQUE keyword means that the index will not accept duplicated values, except for NULLs. An error will raise if you try to insert duplicate values in a UNIQUE index. For UNIQUE indexes, you can specify a name for the constraint, using the CONSTRAINT keyword. That name will be used in error messages. See Getting Started with Indexes: Unique Index for more information.\n\nDROP UNIQUE INDEX\n\nDrops a unique index. The UNIQUE keyword means that the index will not accept duplicated values, except for NULLs. An error will raise if you try to insert duplicate values in a UNIQUE index. For UNIQUE indexes, you can specify a name for the constraint, using the CONSTRAINT keyword. That name will be used in error messages. See Getting Started with Indexes: Unique Index for more information.\n\nADD FULLTEXT INDEX\n\nAdds a FULLTEXT index. See Full-Text Indexes for more information.\n\nDROP FULLTEXT INDEX\n\nDrops a FULLTEXT index. See Full-Text Indexes for more information.\n\nADD SPATIAL INDEX\n\nAdds a SPATIAL index. See SPATIAL INDEX for more information.\n\nDROP SPATIAL INDEX\n\nDrops a SPATIAL index. See SPATIAL INDEX for more information.\n\nENABLE/ DISABLE KEYS\n\nDISABLE KEYS disables all non unique keys for the table for storage engines that support this (at least MyISAM and Aria). This can be used to speed up inserts into empty tables. ENABLE KEYS enables all disabled keys.\n\nRENAME TO\n\nRenames a table. See also RENAME TABLE.\n\nADD CONSTRAINT\n\nModifies the table adding a constraint on a particular column or columns.\n\n`sql\nALTER TABLE table_name \nADD CONSTRAINT [constraint_name] CHECK(\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table/README');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (616, 39, 'Online Schema Change', 'Description\n-----------\n\nThis functionality is available from MariaDB 11.4.\n\nThe term _Online Schema Change_ refers to the ability to update the table schema without blocking concurrent DML[^1] statements for the duration of the schema change.\n\nExamples\n--------\n\nALTER TABLE items ADD ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table/online-schema-change', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table/online-schema-change');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (617, 39, 'ALTER TABLESPACE', 'Description\n-----------\n\nThe ALTER TABLESPACE statement is not supported by MariaDB. It was originally inherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is also supported for InnoDB. However, MariaDB has chosen not to include that specific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-tablespace', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-tablespace');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (618, 39, 'Atomic DDL', 'Description\n-----------\n\nWe improved readability for DDL (Data Definition Language) operations to make most of them atomic, and the rest crash-safe, even if the server crashes in the middle of an operation.\n\nThese improvements were made in MariaDB 10.6.1.\n\nThe design of Atomic/Crash-safe DDL (MDEV-17567) allows it to work with all storage engines.\n\nDefinitions\n\n Atomic means that either the operation succeeds (and is logged to the binary log or is completely reversed.\n Crash-safe means that in case of a crash, after the server has restarted, all tables are consistent, there are no temporary files or tables on disk and the binary log matches the status of the server.\n DDL Data definition language.\n DML Data manipulation language.\n ''DDL recovery log'' or ''DDL log'' for short, is the new log file, ddl_recovery.log by default, that stores all DDL operations in progress. This is used to recover the state of the server in case of sudden crash.\n\nBackground\n\nBefore 10.6, in case of a crash, there was a small possibility that one of the following things could happen:\n\n There could be temporary tables starting with #sql-alter or #sql-shadow or temporary files ending with '''' left.\n The table in the storage engine and the table''s .frm file could be out of sync.\n During a multi-table rename, only some of the tables were renamed.\n\nWhich DDL Operations are Now Atomic\n\n CREATE TABLE, except when used with CREATE OR REPLACE, which is only crash safe.\n RENAME TABLE and RENAME TABLES.\n CREATE VIEW\n CREATE SEQUENCE\n CREATE TRIGGER\n DROP TRIGGER\n DROP TABLE and DROP VIEW. Dropping multiple tables is only crash safe.\n ALTER TABLE\n ALTER SEQUENCE is not listed above as it is internally implemented as a DML.\n\nWhich DDL Operations are Now Crash Safe\n\nDROP TABLE of Multiple Tables.\n\nDROP TABLE over multiple tables is treated as if every DROP is a separate, atomic operation. This means that after a crash, all fully, or partly, dropped tables will be dropped and logged to the binary log. The undropped tables will be left untouched.\n\nCREATE OR REPLACE TABLE\n\nCREATE OR REPLACE TABLE foo is implemented as:\n\n``sql\nDROP TABLE IF EXISTS foo;\nCREATE TABLE foo ...\n`\n\nThis means that if there is a crash during CREATE TABLE then the original table ''foo'' will be dropped even if the new table was not created.\\\nIf the table was not re-created, the binary log will contain theDROP TABLE.\n\nDROP DATABASE\n\nDROP DATABASE is implemented as:\n\n`sql\n  DROP TABLE table\nLOOP OVER ALL tables\n`\n\nEach DROP TABLE is atomic, but in case of a crash, things will work the same way as DROP TABLE with multiple tables.\n\nAtomic with Different Storage Engines\n\nAtomic/Crash-safe DDL works with all storage engines that either have atomic DDLs internally or are able to re-execute DROP or RENAME in case of failure.\n\nThis should be true for most storage engines. The ones that still need some work are:\n\n The S3 storage engine.\n The partitioning engine. Partitioning should be atomic for most cases, but there are still some known issues that need to be tested and fixed.\n\nThe DDL Log Recovery File\n\nThe new startup option --log-ddl-recovery=path (ddl_recovery.log by default) can be used to specify the place for the DDL log file. This is mainly useful in the case when one has a filesystem on persistent memory, as there is a lot of sync on this file during DDL operations.\n\nThis file contains all DDL operations that are in progress.\n\nAt MariaDB server startup, the DDL log file is copied to a file with the same base name but with a backup.log suffix. This is mainly done to be able to find out what went wrong if recovery fails.\n\nIf the server crashes during recovery (unlikely but possible), the recovery will continue where it was before. The recovery will retry each entry up to 3 times before giving up and proceeding with the next entry.\n\nConclusions\n\n We believe that a clean separation of layers leads to an easier-to-maintain solution. The Atomic DDL implementation in MariaDB 10.6 introduced minimal changes to the storage engine API, mainly for native ALTER TABLE.\n In our InnoDB implementation, no file format changes were needed on top of the RENAME undo log that was introduced in MariaDB 10.2.19 for a backup-safe TRUNCATE re-implementation. Correct use of sound design principles (write-ahead logging and transactions; also file creation now follows the ARIES protocol) is sufficient. We removed the hacks (at most one CREATE or DROP per transaction) and correctly implemented rollback and purge` triggers for the InnoDB SYS_INDEXES table.\n Numerous DDL recovery bugs in InnoDB were found and fixed quickly thanks to rr-project.org. We are still working on one: data files must not be deleted before the DDL transaction is committed.\n\nThanks to Atomic/Crash-safe DDL, the MariaDB server is now much more stable and reliable in unstable environments. There is still ongoing work to fix the few remaining issues mentioned above to make all DDL operations Atomic.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/atomic-ddl', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/atomic-ddl');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (619, 39, 'CONSTRAINT', 'Syntax\n------\n\n[CONSTRAINT [symbol]] constraint_expression\n\nconstraint_expression:\n  | PRIMARY KEY [index_type] (index_col_name, ...) [index_option] ...\n  | FOREIGN KEY [index_name] (index_col_name, ...) \n       REFERENCES tbl_name (index_col_name, ...)\n       [ON DELETE reference_option]\n       [ON UPDATE reference_option]\n  | UNIQUE [INDEX|KEY] [index_name]\n       [index_type] (index_col_name, ...) [index_option] ...\n  | CHECK (check_constraints)\n\nindex_type:\n  USING {BTREE | HASH | RTREE}\n\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\n\nindex_option:\n  | KEY_BLOCK_SIZE [=] value\n  | index_type\n  | WITH PARSER parser_name\n  | COMMENT ''string''\n  | CLUSTERING={YES|NO}\n\nreference_option:\n  RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nDescription\n-----------\n\nConstraints provide restrictions on the data you can add to a table. This allows to enforce data integrity in MariaDB, rather than through application logic. When a statement violates a constraint, MariaDB throws an error.\n\nThere are four types of table constraints:\n\n PRIMARY KEY – Sets the column for referencing rows. Values must be UNIQUE and NOT NULL.&#x20;\n   This constraint is documented here.\n FOREIGN KEY – Sets the column to reference the primary key on another table.&#x20;\n   This constraint is documented here and, in more detail, here and here.\n UNIQUE – Requires values in column or columns only occur once in the table.&#x20;\n   This constraint is documented here.\n CHECK – Checks whether the data meets the given condition.&#x20;\n   This constraint is documented here and, in more detail, here.\n\nThe Information Schema TABLE_CONSTRAINTS Table contains information about tables that have constraints:\n\n``sql\nSELECT CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE  FROM information_schema.TABLE_CONSTRAINTS LIMIT 5;\n+-------------------+----------------------+---------------+-----------------+\n| CONSTRAINT_SCHEMA | CONSTRAINT_NAME      | TABLE_NAME    | CONSTRAINT_TYPE |\n+-------------------+----------------------+---------------+-----------------+\n| nation            | PRIMARY              | countries     | PRIMARY KEY     |\n| nation            | country_code2        | countries     | UNIQUE          |\n| nation            | country_code3        | countries     | UNIQUE          |\n| nation            | countries_ibfk_1     | countries     | FOREIGN KEY     |\n| nation            | PRIMARY              | regions       | PRIMARY KEY     |\n+-------------------+----------------------+---------------+-----------------+\n`\n\nFOREIGN KEY Constraints\n\nInnoDB supports foreign key constraints. The syntax for a foreign key constraint definition in InnoDB looks like this:\n\n`sql\n[CONSTRAINT [symbol]] FOREIGN KEY\n    [index_name] (index_col_name, ...)\n    REFERENCES tbl_name (index_col_name,...)\n    [ON DELETE reference_option]\n    [ON UPDATE reference_option]\n\nreference_option:\n    RESTRICT | CASCADE | SET NULL | NO ACTION\n`\n\nThe symbol clause is optional. If you omit it, MariaDB automatically sets one.&#x20;\n\nThe Information Schema REFERENTIAL_CONSTRAINTS table has more information about foreign keys:\n\n`sql\nSELECT  FROM information_schema.REFERENTIAL_CONSTRAINTS LIMIT 2 \\G\n*********************** 1. row *********************\n       CONSTRAINT_CATALOG: def\n        CONSTRAINT_SCHEMA: nation\n          CONSTRAINT_NAME: countries_ibfk_1\nUNIQUE_CONSTRAINT_CATALOG: def\n UNIQUE_CONSTRAINT_SCHEMA: nation\n   UNIQUE_CONSTRAINT_NAME: PRIMARY\n             MATCH_OPTION: NONE\n              UPDATE_RULE: RESTRICT\n              DELETE_RULE: RESTRICT\n               TABLE_NAME: countries\n    REFERENCED_TABLE_NAME: regions\n********************* 2. row ***********************\n       CONSTRAINT_CATALOG: def\n        CONSTRAINT_SCHEMA: nation\n          CONSTRAINT_NAME: regions_ibfk_1\nUNIQUE_CONSTRAINT_CATALOG: def\n UNIQUE_CONSTRAINT_SCHEMA: nation\n   UNIQUE_CONSTRAINT_NAME: PRIMARY\n             MATCH_OPTION: NONE\n              UPDATE_RULE: RESTRICT\n              DELETE_RULE: RESTRICT\n               TABLE_NAME: regions\n    REFERENCED_TABLE_NAME: continents\n`\n\nFrom MariaDB 12.1, multiple tables in the same database are allowed to use the same constraint name.\n\nConsider this example, which creates two tables, then adds constraints to them:\n\n`sql\nCREATE TABLE t1(a int, b int, key(a),key(b))engine=innodb;\nCREATE TABLE t2(a int, b int, key(a),key(b))engine=innodb;\nALTER TABLE t2 ADD CONSTRAINT c FOREIGN KEY (b) REFERENCES t1(a);\nALTER TABLE t1 ADD CONSTRAINT c FOREIGN KEY (b) REFERENCES t2(a);\n`\n\nPreviously, the last statement failed because of duplicate constraint names:\n\n`\nmysqltest: At line 5: query ''alter table t1 add constraint c foreign key (b) references t2(a)'' failed: ER_CANT_CREATE_TABLE (1005): Can''t create table test.t1 (errno: 121 "Duplicate key on write or update")\n`\n\nNow, the statement works, because internally, names are assigned that aren''t duplicates. (User-visible names can be duplicates, but internally they''re prefixed with the schema and table names.)\n\nCHECK Constraints\n\nConstraints are enforced. You can define constraints in 2 different ways:\n\n CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the order they are defined. If any constraint expression returns false, then the row is not inserted or updated. You can use most deterministic functions in a constraint, including UDFs.\n\n`sql\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater CHECK (a>b));\n`\n\nIf you use the CONSTRAINT [constraint_name] CHECK (expression) format and don''t give a name to the constraint, the constraint gets an automatically generated name. This is done so that you can later delete it with ALTER TABLE DROP _constraint_.\n\nYou can disable all constraint expression checks by setting the check_constraint_checks variable to OFF`. This is useful for example when loading a table that violates some constraints that you want to later find and fix in SQL.\n\nReplication\n\nIn row-based replication, only the master checks constraints, and failed statements are not replicated. In statement-based replication, the slaves also check constraints. Constraints should therefore be identical, as well as deterministic, in a replication environment.\n\nAuto_increment\n\nauto_increment columns are not permitted in check constraints.\n\nExamples\n--------\n\nCREATE TABLE product (category INT NOT NULL, id INT NOT NULL,\n                      price DECIMAL,\n                      PRIMARY KEY(category, id)) ENGINE=INNODB;\nCREATE TABLE customer (id INT NOT NULL,\n                       PRIMARY KEY (id)) ENGINE=INNODB;\nCREATE TABLE product_order (NO INT NOT NULL AUTO_INCREMENT,\n                            product_category INT NOT NULL,\n                            product_id INT NOT NULL,\n                            customer_id INT NOT NULL,\n                            PRIMARY KEY(NO),\n                            INDEX (product_category, product_id),\n                            FOREIGN KEY (product_category, product_id)\n                              REFERENCES product(category, id)\n                              ON UPDATE CASCADE ON DELETE RESTRICT,\n                            INDEX (customer_id),\n                            FOREIGN KEY (customer_id)\n                              REFERENCES customer(id)) ENGINE=INNODB;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/constraint', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/constraint');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (620, 39, 'CREATE', 'Description\n-----------\n\ncreate-catalog.md\n\ncreate-database.md\n\ncreate-event.md\n\ncreate-function.md\n\ncreate-function-udf.md\n\ncreate-index.md\n\ncreate-logfile-group.md\n\ncreate-package.md\n\ncreate-package-body.md\n\ncreate-procedure.md\n\ncreate-role.md\n\ncreate-sequence.md\n\ncreate-server.md\n\ncreate-table.md\n\ncreate-table-with-vectors.md\n\ncreate-tablespace.md\n\ncreate-trigger.md\n\ncreate-user.md\n\ncreate-view.md\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/README', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/README');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (621, 39, 'CREATE DATABASE', 'Syntax\n------\n\nCREATE [OR REPLACE] {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n    [create_specification] ...\n\ncreate_specification:\n    [DEFAULT] CHARACTER SET [=] charset_name\n  | [DEFAULT] COLLATE [=] collation_name\n  | COMMENT [=] ''comment''\n\nDescription\n-----------\n\nCREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE.\n\nFor valid identifiers to use as database names, see Identifier Names.\n\nOR REPLACE\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\n``sql\nDROP DATABASE IF EXISTS db_name;\nCREATE DATABASE db_name ...;\n`\n\nIF NOT EXISTS\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead of an error if the specified database already exists.\n\nCOMMENT\n\nThe maximum length of a comment is 1024 bytes. If the comment length exceeds this length, an error/warning code 4144 is thrown. The database comment is also added to the db.opt` file, as well as to the information_schema.schemata table.\n\nComments added for databases do not exist.\n\nExamples\n--------\n\nCREATE DATABASE db1;\nQuery OK, 1 row affected (0.18 sec)\n\nCREATE DATABASE db1;\nERROR 1007 (HY000): Can''t create database ''db1''; database exists\n\nCREATE OR REPLACE DATABASE db1;\nQuery OK, 2 rows affected (0.00 sec)\n\nCREATE DATABASE IF NOT EXISTS db1;\nQuery OK, 1 row affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------+\n| Level | Code | Message                                      |\n+-------+------+----------------------------------------------+\n| Note  | 1007 | Can''t create database ''db1''; database exists |\n+-------+------+----------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-database', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-database');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (622, 39, 'CREATE EVENT', 'Syntax\n------\n\nCREATE [OR REPLACE]\n    [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n    EVENT \n    [IF NOT EXISTS]\n    event_name    \n    ON SCHEDULE schedule\n    [ON COMPLETION [NOT] PRESERVE]\n    [ENABLE | DISABLE | DISABLE ON SLAVE]\n    [COMMENT ''comment'']\n    DO sql_statement;\n\nschedule:\n    AT timestamp [+ INTERVAL interval] ...\n  | EVERY interval \n    [STARTS timestamp [+ INTERVAL interval] ...] \n    [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n    quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n              WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n              DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nDescription\n-----------\n\nThis statement creates and schedules a new event. It requires the EVENT privilege for the schema in which the event is to be created.\n\nThe minimum requirements for a valid CREATE EVENT statement are as follows:\n\n The keywords CREATE EVENT plus an event name, which uniquely identifies the event in the current schema.\n An ON SCHEDULE clause, which determines when and how often the event executes.\n* A DO clause, which contains the SQL statement to be executed by an event.\n\nHere is an example of a minimal CREATE EVENT statement:\n\n``sql\nCREATE EVENT myevent\n    ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n    DO\n      UPDATE myschema.mytable SET mycol = mycol + 1;\n`\n\nThe previous statement creates an event named myevent. This event executes once\\\n— one hour following its creation\\\n— by running an SQL statement that increments the value of the myschema.mytable table''s mycol column by 1.\n\nThe event_name must be a valid MariaDB identifier with a maximum length of 64 characters. It may be delimited using back ticks, and may be qualified with the name of a database schema. An event is associated with both a MariaDB user (the definer) and a schema, and its name must be unique among names of events within that schema. In general, the rules governing event names are the same as those for names of stored routines. See Identifier Names.\n\nIf no schema is indicated as part of event_name, the default (current) schema is assumed.\n\nFor valid identifiers to use as event names, see Identifier Names.\n\nOR REPLACE\n\nThe OR REPLACE clause works like this: If the event already exists, instead of an error being returned, the existing event will be dropped and replaced by the newly defined event.\n\nThe OR REPLACE clause is not available.\n\nIF NOT EXISTS\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of an error if the event already exists. Cannot be used together with OR REPLACE.\n\nON SCHEDULE\n\nThe ON SCHEDULE clause can be used to specify when the event must be triggered.\n\nAT\n\nIf you want to execute the event only once (one time event), you can use the AT keyword, followed by a timestamp. If you use CURRENT_TIMESTAMP, the event acts as soon as it is created. As a convenience, you can add one or more intervals to that timestamp. You can also specify a timestamp in the past, so that the event is stored but not triggered, until you modify it via ALTER EVENT.\n\nThe following example shows how to create an event that will be triggered tomorrow at a certain time:\n\n`sql\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n`\n\nYou can also specify that an event must be triggered at a regular interval (recurring event). In such cases, use the EVERY clause followed by the interval.\n\nIf an event is recurring, you can specify when the first execution must happen via the STARTS clause and a maximum time for the last execution via the ENDS clause. STARTS and ENDS clauses are followed by a timestamp and, optionally, one or more intervals. The ENDS clause can specify a timestamp in the past, so that the event is stored but not executed until you modify it via ALTER EVENT.\n\nIn the following example, next month a recurring event will be triggered hourly for a week:\n\n`sql\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n`\n\nIntervals consist of a quantity and a time unit. The time units are the same used for other statements and time functions, except that you can''t use microseconds for events. For simple time units, like HOUR or MINUTE, the quantity is an integer number, for example ''10 MINUTE''. For composite time units, like HOUR_MINUTE or HOUR_SECOND, the quantity must be a string with all involved simple values and their separators, for example ''2:30'' or ''2:30:30''.\n\nON COMPLETION \\[NOT] PRESERVE\n\nThe ON COMPLETION clause can be used to specify if the event must be deleted after its last execution (that is, after its AT or ENDS timestamp is past). By default, events are dropped when they are expired. To explicitly state that this is the desired behaviour, you can use ON COMPLETION NOT PRESERVE. Instead, if you want the event to be preserved, you can use ON COMPLETION PRESERVE.\n\nIn you specify ON COMPLETION NOT PRESERVE, and you specify a timestamp in the past for AT or ENDS clause, the event will be immediately dropped. In such cases, you will get a Note 1558: "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation".\n\nENABLE/DISABLE/DISABLE ON SLAVE\n\nEvents are ENABLEd by default. If you want to stop MariaDB from executing an event, you may specify DISABLE. When it is ready to be activated, you may enable it using ALTER EVENT. Another option is DISABLE ON SLAVE, which indicates that an event was created on a master and has been replicated to the slave, which is prevented from executing the event. If DISABLE ON SLAVE is specifically set, the event will be disabled everywhere. It will not be executed on the master or the slaves.\n\nCOMMENT\n\nThe COMMENT clause may be used to set a comment for the event. Maximum length for comments is 64 characters. The comment is a string, so it must be quoted. To see events comments, you can query the INFORMATION_SCHEMA.EVENTS table (the column is named EVENT_COMMENT`).\n\nExamples\n--------\n\nCREATE EVENT myevent\n    ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n    DO\n      UPDATE myschema.mytable SET mycol = mycol + 1;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-event', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-event');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (623, 39, 'CREATE FUNCTION', 'Syntax\n------\n\nCREATE [OR REPLACE]\n    [DEFINER = {user | CURRENT_USER | role | CURRENT_ROLE }]\n    [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name ([func_parameter[,...]])\n    RETURNS type\n    [characteristic ...]\n    func_body\n\nfunc_parameter:\n    [ OUT | INOUT | IN OUT ] param_name type |\n    [ IN ] param_name type [DEFAULT value or expression]\n\ntype:\n    Any valid MariaDB data type\n\ncharacteristic:\n    LANGUAGE SQL\n  | [NOT] DETERMINISTIC\n  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n  | COMMENT ''string''\n\nfunc_body:\n    Valid SQL procedure statement\n\nDescription\n-----------\n\nUse the CREATE FUNCTION statement to create a new stored function. You must have the CREATE ROUTINE database privilege to use CREATE FUNCTION. A function takes any number of arguments and returns a value from the function body. The function body can be any valid SQL expression as you would use, for example, in any select expression. If you have the appropriate privileges, you can call the function exactly as you would any built-in function. See Security below for details on privileges.\n\nYou can also use a variant of the CREATE FUNCTION statement to install a user-defined function (UDF) defined by a plugin. See CREATE FUNCTION (UDF) for details.\n\nYou can use a SELECT statement for the function body by enclosing it in parentheses, exactly as you would to use a subselect for any other expression. The SELECT statement must return a single value. If more than one column is returned when the function is called, error 1241 results. If more than one row is returned when the function is called, error 1242 results. Use a LIMIT clause to ensure only one row is returned.\n\nYou can also replace the RETURN clause with a BEGIN...END compound statement. The compound statement must contain a RETURN statement. When the function is called, the RETURN statement immediately returns its result, and any statements after RETURN are effectively ignored.\n\nBy default, a function is associated with the current database. To associate the function explicitly with a given database, specify the fully-qualified name as db_name.func_name when you create it. If the function name is the same as the name of a built-in function, you must use the fully qualified name when you call it.\n\nThe parameter list enclosed within parentheses must always be present. If there are no parameters, an empty parameter list of () should be used. Parameter names are not case-sensitive.\n\nEach parameter can be declared to use any valid data type, except that the COLLATE attribute cannot be used.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nRETURN\n\nThe RETURN clause can return a function body. In newer versions of MariaDB, it can also return a cursor (using SYS_REFCURSOR).\n\nRETURN func_body\n\nThe RETURN clause can return a function body (a valid SQL PROCEDURE statement).\n\nRETURN SYS_REFCURSOR\n\nIt can also return a cursor, if the function was declared with a SYS_REFCURSOR variable, like this:\n\n``sql\nCREATE FUNCTION f1 RETURN SYS_REFCURSOR AS\n  c SYS_REFCURSOR;\nBEGIN\n  OPEN c FOR SELECT a FROM t1 ORDER BY a;\n  RETURN c;\nEND;\n/\n`\n\nAlternatively, a cursor can be returned in an OUT parameter, see this section.\n\nRETURN func_body\n\nThe RETURN clause can return a function body (a valid SQL PROCEDURE statement).\n\nAGGREGATE\n\nIt is possible to create stored aggregate functions as well. See Stored Aggregate Functions for details.\n\nIN | OUT | INOUT | IN OUT\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and not SELECT. These quantifiers are especially useful for creating functions with more than one return value. This allows functions to be more complex and nested.\n\n`sql\nDELIMITER $$\nCREATE FUNCTION add_func3(IN a INT, IN b INT, OUT c INT) RETURNS INT\nBEGIN\n  SET c = 100;\n  RETURN a + b;\nEND;\n$$\nDELIMITER ;\n \nSET @a = 2;\nSET @b = 3;\nSET @c = 0;\nSET @res= add_func3(@a, @b, @c);\n\nSELECT add_func3(@a, @b, @c);\nERROR 4186 (HY000): OUT or INOUT argument 3 for function add_func3 is not allowed here\n\nDELIMITER $$\nCREATE FUNCTION add_func4(IN a INT, IN b INT, d INT) RETURNS INT\nBEGIN\n  DECLARE c, res INT;\n  SET res = add_func3(a, b, c) + d;\n  if (c > 99) then\n    return  3;\n  else\n    return res;\n  end if;\nEND;\n$$\n\nDELIMITER ;\n\nSELECT add_func4(1,2,3);\n+------------------+\n| add_func4(1,2,3) |\n+------------------+\n|                3 |\n+------------------+\n`\n\nQuantifiers are not available.\n\nA cursor can be returned, like this:\n\n`sql\nCREATE TABLE t1 (a INT);\nINSERT INTO t1 VALUES (10),(20);\n \nCREATE FUNCTION f1 RETURN SYS_REFCURSOR AS\n  c SYS_REFCURSOR;\nBEGIN\n  OPEN c FOR SELECT a FROM t1 ORDER BY a;\n  RETURN c;\nEND;\n/\n \nCREATE PROCEDURE p1 AS\n  a INT;\n  c SYS_REFCURSOR DEFAULT f1();\nBEGIN\n  LOOP\n    FETCH c INTO a;\n    EXIT WHEN c%NOTFOUND;\n    dbms_output.put_line(a);\n  END LOOP;\n  CLOSE c;\n  END;\n/\n \nCALL p1();\n`\n\nThis feature is not available.\n\nRETURNS\n\nThe RETURNS clause specifies the return type of the function. NULL values are permitted with all return types.\n\nWhat happens if the RETURN clause returns a value of a different type? It depends on the SQL_MODE in effect at the moment of the function creation.\n\nIf the SQL_MODE is strict (STRICT_ALL_TABLES or STRICT_TRANS_TABLES flags are specified), a 1366 error will be produced.\n\nOtherwise, the value is coerced to the proper type. For example, if a function specifies an ENUM or SET value in the RETURNS clause, but the RETURN clause returns an integer, the value returned from the function is the string for the corresponding ENUM member of set of SET members.\n\nMariaDB stores the SQL_MODE system variable setting that is in effect at the time a routine is created, and always executes the routine with this setting in force, regardless of the server SQL mode in effect when the routine is invoked.\n\nLANGUAGE SQL\n\nLANGUAGE SQL is a standard SQL clause which can be used in MariaDB for portability. However that clause has no meaning, because SQL is the only supported language for stored functions.\n\nA function is deterministic if it can produce only one result for a given list of parameters. If the result may be affected by stored data, server variables, random numbers or any value that is not explicitly passed, then the function is not deterministic. Also, a function is non-deterministic if it uses nondeterministic functions like NOW() or CURRENT_TIMESTAMP(). The optimizer may choose a faster execution plan if it known that the function is deterministic. In such cases, you should declare the routine using the DETERMINISTIC keyword. If you want to explicitly state that the function is not deterministic (which is the default) you can use the NOT DETERMINISTIC keywords.\n\nIf you declare a non-deterministic function as DETERMINISTIC, you may get incorrect results. If you declare a deterministic function as NOT DETERMINISTIC, in some cases the queries will be slower.\n\nOR REPLACE\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\n`sql\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION function_name ...;\n`\n\nwith the exception that any existing privileges for the function are not dropped.\n\nIF NOT EXISTS\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of an error if the function already exists. Cannot be used together with OR REPLACE.\n\n\\[NOT] DETERMINISTIC\n\nThe [NOT] DETERMINISTIC clause also affects binary logging, because the STATEMENT format can not be used to store or replicate non-deterministic statements.\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative clauses that tell the server what the function does. MariaDB does not check in any way whether the specified clause is correct. If none of these clauses are specified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA\n\nMODIFIES SQL DATA means that the function contains statements that may modify data stored in databases. This happens if the function contains statements like DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA\n\nREADS SQL DATA means that the function reads data stored in databases, but does not modify any data. This happens if SELECT statements are used, but there no write operations are executed.\n\nCONTAINS SQL\n\nCONTAINS SQL means that the function contains at least one SQL statement, but it does not read or write any data stored in a database. Examples include SET or DO.\n\nNO SQL\n\nNO SQL means nothing, because MariaDB does not currently support any language other than SQL.\n\nOracle Mode\n\nA subset of Oracle''s PL/SQL language is supported in addition to the traditional SQL/PSM-based MariaDB syntax. See Oracle mode for details on changes when running Oracle mode.\n\nSecurity\n\nYou must have the EXECUTE privilege on a function to call it. MariaDB automatically grants the EXECUTE and ALTER ROUTINE privileges to the account that called CREATE FUNCTION, even if the DEFINER clause was used.\n\nEach function has an account associated as the definer. By default, the definer is the account\\\nthat created the function. Use the DEFINER clause to specify a different account as the\\\ndefiner. You must have the SET USER privilege to use the DEFINER clause. See Account Names for details on specifying accounts.\n\nThe SQL SECURITY clause specifies what privileges are used when a function is called. If SQL SECURITY is INVOKER, the function body will be evaluated using the privileges of the user calling the function. If SQL SECURITY is DEFINER, the function body is always evaluated using the privileges of the definer account. DEFINER is the default.\n\nThis allows you to create functions that grant limited access to certain data. For example, say you have a table that stores some employee information, and that you''ve granted SELECT privileges only on certain columns to the user account roger.\n\n`sql\nCREATE TABLE employees (name TINYTEXT, dept TINYTEXT, salary INT);\nGRANT SELECT (name, dept) ON employees TO roger;\n`\n\nTo allow the user the get the maximum salary for a department, define a function and grant the EXECUTE privilege:\n\n`sql\nCREATE FUNCTION max_salary (dept TINYTEXT) RETURNS INT RETURN\n  (SELECT MAX(salary) FROM employees WHERE employees.dept = dept);\nGRANT EXECUTE ON FUNCTION max_salary TO roger;\n`\n\nSince SQL SECURITY defaults to DEFINER, whenever the user roger calls this function, the subselect will execute with your privileges. As long as you have privileges to select the salary of each employee, the caller of the function will be able to get the maximum salary for each department without being able to see individual salaries.\n\nCharacter Sets and Collations\n\nFunction return types can be declared to use any valid character set and collation. If used, the COLLATE attribute needs to be preceded by a CHARACTER SET` attribute.\n\nIf the character set and collation are not specifically set in the statement, the database defaults at the time of creation will be used. If the database defaults change at a later stage, the stored function character set/collation will not be changed at the same time; the stored function needs to be dropped and recreated to ensure the same character set/collation as the database is used.\n\nExamples\n--------\n\nCREATE FUNCTION hello (s CHAR(20))\n    RETURNS CHAR(50) DETERMINISTIC\n    RETURN CONCAT(''Hello, '',s,''!'');\n\nSELECT hello(''world'');\n+----------------+\n| hello(''world'') |\n+----------------+\n| Hello, world!  |\n+----------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-function', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-function');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (624, 39, 'CREATE INDEX', 'Syntax\n------\n\nCREATE [OR REPLACE] [UNIQUE|FULLTEXT|SPATIAL|VECTOR] INDEX \n  [IF NOT EXISTS] index_name\n    [index_type]\n    ON tbl_name (index_col_name,...)\n    [WAIT n | NOWAIT]\n    [index_option]\n    [algorithm_option | lock_option] ...\n\nindex_col_name:\n    col_name [(length)] [ASC | DESC]\n\nindex_type:\n    USING {BTREE | HASH | RTREE}\n\nindex_option:\n    [ KEY_BLOCK_SIZE [=] value\n  | index_type\n  | WITH PARSER parser_name\n  | COMMENT ''string''\n  | CLUSTERING={YES| NO} ]\n  [ IGNORED | NOT IGNORED ]\n  | DISTANCE={EUCLIDEAN| COSINE} ]\n  | M=number ]\n\nalgorithm_option:\n    ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n\nlock_option:\n    LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDescription\n-----------\n\nThe CREATE INDEX statement is used to add indexes to a table. Indexes can be created at the same as the table, with the CREATE TABLE statement. In some cases, such as for InnoDB primary keys, doing so during creation is preferable, as adding a primary key will involve rebuilding the table.\n\nThe statement is mapped to an ALTER TABLE statement to create indexes. See ALTER TABLE. CREATE INDEX cannot be used to create a PRIMARY KEY; use ALTER TABLE instead.\n\nIf another connection is using the table, a metadata lock is active, and this statement will wait until the lock is released. This is also true for non-transactional tables.\n\nAnother shortcut, DROP INDEX, allows the removal of an index.\n\nFor valid identifiers to use as index names, see Identifier Names.\n\nFor limits on InnoDB indexes, see InnoDB Limitations.\n\nNote that KEY_BLOCK_SIZE is currently ignored in CREATE INDEX, although it is included in the output of SHOW CREATE TABLE.\n\nPrivileges\n\nExecuting the CREATE INDEX statement requires the INDEX privilege for the table or the database.\n\nOnline DDL\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nCREATE OR REPLACE INDEX\n\nIf the OR REPLACE clause is used and if the index already exists, then instead of returning an error, the server will drop the existing index and replace it with the newly defined index.\n\nCREATE INDEX IF NOT EXISTS\n\nIf the IF NOT EXISTS clause is used, then the index will only be created if an index with the same name does not already exist. If the index already exists, then a warning will be triggered by default.\n\nIndex Definitions\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nWAIT/NOWAIT\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nALGORITHM\n\nSee ALTER TABLE: ALGORITHM for more information.\n\nLOCK\n\nSee ALTER TABLE: LOCK for more information.\n\nProgress Reporting\n\nMariaDB provides progress reporting for CREATE INDEX statement for clients that support the new progress reporting protocol. For example, if you were using the mariadb client, then the progress report might look like this::\n\n``sql\nCREATE INDEX i ON tab (num);\nStage: 1 of 2 ''copy to tmp table''    46% of stage\n`\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST statement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nWITHOUT OVERLAPS\n\nThe WITHOUT OVERLAPS clause allows you to constrain a primary or unique index such that application-time periods cannot overlap. It can be used like this:\n\n`sql\nCREATE UNIQUE INDEX u ON rooms (room_number, p WITHOUT OVERLAPS);\n`\n\nWITHOUT OVERLAPS` is not available.\n\nExamples\n--------\n\nCREATE UNIQUE INDEX HomePhone ON Employees(Home_Phone);\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-index', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-index');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (625, 39, 'CREATE LOGFILE GROUP', 'Description\n-----------\n\nThe CREATE LOGFILE GROUP statement is not supported by MariaDB. It was originally inherited from MySQL NDB Cluster. See MDEV-19295 for more information.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-logfile-group', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-logfile-group');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (626, 39, 'CREATE PACKAGE BODY', 'Syntax\n------\n\nCREATE [ OR REPLACE ]\n    [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n    PACKAGE BODY\n    [ IF NOT EXISTS ]\n    [ db_name . ] package_name\n    [ package_characteristic... ]\n{ AS | IS }\n    package_implementation_declare_section\n    package_implementation_executable_section\nEND [ package_name]\n\npackage_implementation_declare_section:\n    package_implementation_item_declaration\n      [ package_implementation_item_declaration... ]\n      [ package_implementation_routine_definition... ]\n  | package_implementation_routine_definition\n      [ package_implementation_routine_definition...]\n\npackage_implementation_item_declaration:\n    variable_declaration ;\n\nvariable_declaration:\n    variable_name[,...] type [:= expr ]\n\npackage_implementation_routine_definition:\n    FUNCTION package_specification_function\n       [ package_implementation_function_body ] ;\n  | PROCEDURE package_specification_procedure\n       [ package_implementation_procedure_body ] ;\n\npackage_implementation_function_body:\n    { AS | IS } package_routine_body [func_name]\n\npackage_implementation_procedure_body:\n    { AS | IS } package_routine_body [proc_name]\n\npackage_routine_body:\n    [ package_routine_declarations ]\n    BEGIN\n      statements [ EXCEPTION exception_handlers ]\n    END\n\npackage_routine_declarations:\n    package_routine_declaration '';'' [package_routine_declaration '';'']...\n\npackage_routine_declaration:\n          variable_declaration\n        | condition_name CONDITION FOR condition_value\n        | user_exception_name EXCEPTION\n        | CURSOR_SYM cursor_name\n          [ ( cursor_formal_parameters ) ]\n          IS select_statement\n        ;\n\npackage_implementation_executable_section:\n          END\n        | BEGIN\n            statement ; [statement ; ]...\n          [EXCEPTION exception_handlers]\n          END\n\nexception_handlers:\n           exception_handler [exception_handler...]\n\nexception_handler:\n          WHEN_SYM condition_value [, condition_value]...\n            THEN_SYM statement ; [statement ;]...\n\ncondition_value:\n          condition_name\n        | user_exception_name\n        | SQLWARNING\n        | SQLEXCEPTION\n        | NOT FOUND\n        | OTHERS_SYM\n        | SQLSTATE [VALUE] sqlstate_value\n        | mariadb_error_code\n\nDescription\n-----------\n\nThe CREATE PACKAGE BODY statement creates the package body for a stored package. The package specification must be previously created using the CREATE PACKAGE statement.\n\nA package body provides implementations of the package public routines and can optionally have:\n\n package-wide private variables\n package private routines\n forward declarations for private routines\n an executable initialization section\n\n> Starting with MariaDB 13.0.1, package bodies can define RECORD and REF CURSOR types that can be used as:\n>\n>  Parameters (IN, OUT, INOUT) for procedures and functions defined in the package\n>  RETURN clause data types for package functions\n>\n> For detailed syntax and examples, see DECLARE TYPE.<br>\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n  FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n  PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n  PROCEDURE raiseSalaryStd(eid INT);\n  PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nCREATE PACKAGE BODY employee_tools AS\n  -- package body variables\n  stdRaiseAmount DECIMAL(10,2):=500;\n\n  -- private routines\n  PROCEDURE log (eid INT, ecmnt TEXT) AS\n  BEGIN\n    INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n  END;\n\n  -- public routines\n  PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n    eid INT;\n  BEGIN\n    INSERT INTO employee (name, salary) VALUES (ename, esalary);\n    eid:= last_insert_id();\n    log(eid, ''hire '' || ename);\n  END;\n\n  FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n    nSalary DECIMAL(10,2);\n  BEGIN\n    SELECT salary INTO nSalary FROM employee WHERE id=eid;\n    log(eid, ''getSalary id='' || eid || '' salary='' || nSalary);\n    RETURN nSalary;\n  END;\n\n  PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n  BEGIN\n    UPDATE employee SET salary=salary+amount WHERE id=eid;\n    log(eid, ''raiseSalary id='' || eid || '' amount='' || amount);\n  END;\n\n  PROCEDURE raiseSalaryStd(eid INT) AS\n  BEGIN\n    raiseSalary(eid, stdRaiseAmount);\n    log(eid, ''raiseSalaryStd id='' || eid);\n  END;\n\nBEGIN\n  -- This code is executed when the current session\n  -- accesses any of the package routines for the first time\n  log(0, ''Session '' || connection_id() || '' '' || current_user || '' started'');\nEND;\n$$\n\nDELIMITER ;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (627, 39, 'CREATE PACKAGE', 'Syntax\n------\n\nCREATE\n    [ OR REPLACE]\n    [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n    PACKAGE [ IF NOT EXISTS ]\n    [ db_name . ] package_name\n    [ package_characteristic ... ]\n    [ package_specification_element ... ]\nEND\n\npackage_characteristic:\n    COMMENT ''string''\n  | SQL SECURITY { DEFINER | INVOKER }\n\npackage_specification_element:\n    FUNCTION_SYM package_specification_function ;\n  | PROCEDURE_SYM package_specification_procedure ;\n\npackage_specification_function:\n    func_name [ ( func_param [, func_param]... ) ]\n    RETURNS type\n    [ package_routine_characteristic... ]\n\npackage_specification_procedure:\n    proc_name [ ( proc_param [, proc_param]... ) ]\n    [ package_routine_characteristic... ]\n\nfunc_param:\n    param_name [ IN | OUT | INOUT | IN OUT ] type\n\nproc_param:\n    param_name [ IN | OUT | INOUT | IN OUT ] type\n\ntype:\n    Any valid MariaDB explicit or anchored data type\n\npackage_routine_characteristic:\n      COMMENT  ''string''\n    | LANGUAGE SQL\n    | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n    | SQL SECURITY { DEFINER | INVOKER }\n\nDescription\n-----------\n\nCREATE PACKAGE creates the specification for a stored package (a collection of logically related stored objects). A stored package specification declares public routines (procedures and functions) of the package, but does not implement these routines.\n\nA package whose specification was created by the CREATE PACKAGE statement, should later be implemented using the CREATE PACKAGE BODY statement.\n\nFunction parameter quantifiers IN | OUT | INOUT | IN OUT\n\nMariaDB starting with 10.8.0\n\nThe function parameter quantifiers for IN, OUT, INOUT, and IN OUT are supported anywhere.\n\nThe function parameter quantifiers for IN, OUT, INOUT, and IN OUT are supported only in procedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and not SELECT. These quantifiers are especially useful for creating functions and procedures with more than one return value. This allows functions and procedures to be more complex and nested.\n\nExamples\n--------\n\nSET sql_mode=ORACLE; # unnecessary from MariaDB 11.4\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n  FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n  PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n  PROCEDURE raiseSalaryStd(eid INT);\n  PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nDELIMITER ;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (628, 39, 'CREATE SERVER', 'Syntax\n------\n\nCREATE [OR REPLACE] SERVER [IF NOT EXISTS] server_name\n    FOREIGN DATA WRAPPER wrapper_name\n    OPTIONS (option [, option] ...)\n\noption: <= MariaDB 11.6\n  { HOST character-literal\n  | DATABASE character-literal\n  | USER character-literal\n  | PASSWORD character-literal\n  | SOCKET character-literal\n  | OWNER character-literal\n  | PORT numeric-literal }\n\noption: >= MariaDB Enterprise Server 11.4 / Community Server 11.7\n  { HOST character-literal\n  | DATABASE character-literal\n  | USER character-literal\n  | PASSWORD character-literal\n  | SOCKET character-literal\n  | OWNER character-literal\n  | PORT numeric-literal\n  | PORT quoted-numerical-literal\n  | identifier character-literal}\n\nDescription\n-----------\n\nThis statement creates the definition of a server for use with the Spider, Connect, FEDERATED, or FederatedX storage engine. The CREATE SERVER statement creates a new row in the servers table within the mysql database. This statement requires the FEDERATED ADMIN privilege.\n\nThis statement creates the definition of a server for use with the Spider, Connect, FEDERATED, or FederatedX storage engine. The CREATE SERVER statement creates a new row in the servers table within the mysql database. This statement requires the SUPER privilege.\n\nThe server_name should be a unique reference to the server. Server definitions are global within the scope of the server, it is not possible to qualify the server definition to a specific database. server_name has a maximum length of 64 characters (names longer than 64 characters are silently truncated), and is case-insensitive. You may specify the name as a quoted string.\n\nThe wrapper_name may be quoted with single quotes. Supported values are:\n\n mysql\n mariadb&#x20;\n\nFor each option you must specify either a character literal or numeric literal. Character literals are UTF-8, support a maximum length of 64 characters and default to a blank (empty) string. String literals are silently truncated to 64 characters. Numeric literals must be a number between 0 and 9999, default value is 0.\n\nNote: The OWNER option is currently not applied, and has no effect on the ownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table that can later be used with the CREATE TABLE statement when creating a Spider, Connect, FederatedX or FEDERATED table. The options that you specify will be used to populate the columns in the mysql.servers table. The table columns are Server_name, Host, Db, Username, Password, Port, and Socket.\n\nNote: When used with the Spider storage engine, connection information provided via CREATE SERVER may be overridden by table-level or engine-defined parameters. For information on connection configuration and precedence rules, see the Spider Storage Engine Core Concepts page.\n\nDROP SERVER removes a previously created server definition.\n\nCREATE SERVER is not written to the binary log, irrespective of the binary log format being used and therefore will not replicate.\n\nGalera replicates the CREATE SERVER, ALTER SERVER and DROP SERVER statements.\n\nGalera does not replicate the CREATE SERVER, ALTER SERVER and DROP SERVER statements.\n\nFor valid identifiers to use as server names, see Identifier Names.\n\nThe SHOW CREATE SERVER statement can be used to show the CREATE SERVER statement that created a given server definition.\n\nThe SHOW CREATE SERVER statement cannot be used to show the CREATE SERVER statement that created a given server definition.\n\nOR REPLACE\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\n``sql\nDROP SERVER IF EXISTS name;\nCREATE SERVER server_name ...;\n`\n\nIF NOT EXISTS\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of an error if the server already exists. Cannot be used together with OR REPLACE`.\n\nExamples\n--------\n\nCREATE SERVER s\nFOREIGN DATA WRAPPER mariadb\nOPTIONS (USER ''Remote'', HOST ''192.168.1.106'', DATABASE ''test'');\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-server', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-server');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (629, 39, 'CREATE TABLE', 'Description\n-----------\n\nUse the CREATE TABLE statement to create a table with the given name.\n\nIn its most basic form, the CREATE TABLE statement provides a table name followed by a list of columns, indexes, and constraints. By default, the table is created in the default database. Specify a database with db_name.tbl_name. If you quote the table name, you must quote the database name and table name separately as ` db_name.tbl_name . This is particularly useful for CREATE TABLE ... SELECT, because it allows creating a table in a database that contains data from other databases. See Identifier Qualifiers.\n\nIf a table with the same name exists, error 1050 results. Use IF NOT EXISTS to suppress this error and issue a note instead. Use SHOW WARNINGS to see notes.\n\nThe CREATE TABLE statement automatically commits the current transaction, except when using the TEMPORARY keyword.\n\nFor valid identifiers to use as table names, see Identifier Names.\n\nIf the default_storage_engine is set to ColumnStore, it needs to be set on all UMs. Otherwise, when the tables using the default engine are replicated across UMs, they will use the wrong engine. You should therefore not use this option as a session variable with ColumnStore.\n\nMicrosecond precision can be between 0-6. If no precision is specified, it is assumed to be 0, for backward compatibility reasons.\n\nPrivileges\n\nExecuting the CREATE TABLE statement requires the CREATE privilege for the table or the database.\n\nCREATE OR REPLACE\n\nIf the OR REPLACE clause is used and the table already exists, then instead of returning an error, the server will drop the existing table and replace it with the newly defined table.\n\nThis syntax was originally added to make replication more robust if it has to rollback and repeat statements such as CREATE ... SELECT on slaves.\n\n`sql\nCREATE OR REPLACE TABLE table_name (a INT);\n`\n\nis basically the same as:\n\n`sql\nDROP TABLE IF EXISTS TABLE_NAME;\nCREATE TABLE TABLE_NAME (a INT);\n`\n\nwith the following exceptions:\n\n If table_name was locked with LOCK TABLES, it will continue to be locked after the statement.\n Temporary tables are only dropped if the TEMPORARY keyword was used. (With DROP TABLE, temporary tables are preferred to be dropped before normal tables).\n\nThings to be Aware of With CREATE OR REPLACE\n\n The table is dropped first (if it existed), and after that, the CREATE is done. Because of this, if the CREATE fails, then the table will not exist anymore after the statement. If the table was used with LOCK TABLES, it will be unlocked.\n One can''t use OR REPLACE together with IF EXISTS.\n Slaves will, by default, use CREATE OR REPLACE when replicating CREATE statements that don''t use IF EXISTS. This can be changed by setting the variable slave-ddl-exec-mode to STRICT.\n\nCREATE TABLE IF NOT EXISTS\n\nIf the IF NOT EXISTS clause is used, then the table will only be created if a table with the same name does not already exist. If the table already exists, then a warning will be triggered by default.\n\nCREATE TEMPORARY TABLE\n\nUse the TEMPORARY keyword to create a temporary table that is only available to the current session. Temporary tables are dropped when the session ends. Temporary table names are specific to the session. They will not conflict with other temporary tables from other sessions, even if they share the same name. They will shadow names of non-temporary tables or views, if they are identical. A temporary table can have the same name as a non-temporary table, which is located in the same database. In that case, their name will reference the temporary table when used in SQL statements. You must have the CREATE TEMPORARY TABLES privilege on the database to create temporary tables. If no storage engine is specified, the default_tmp_storage_engine setting will determine the engine.\n\nROCKSDB temporary tables cannot be created by setting the default_tmp_storage_engine system variable or using CREATE TEMPORARY TABLE LIKE. If you try, an error is returned. Explicitly creating a temporary table with ENGINE=ROCKSDB has never been permitted.\n\nROCKSDB temporary tables cannot be created by setting the default_tmp_storage_engine system variable, or using CREATE TEMPORARY TABLE LIKE. They can be specified, but fail silently, and a MyISAM table is created instead. Explicitly creating a temporary table with ENGINE=ROCKSDB has never been permitted.\n\nReplicating temporary tables\n\nBy default, temporary tables are only created on the slave if the master is using the STATEMENT binary log format.\n\nThe new deterministic rules for logging of temporary tables are:\n\n The STATEMENT binlog format is used. The user can change this behavior by setting create_tmp_table_binlog_formats to MIXED, STATEMENT in which case the create is logged in statement format also in MIXED mode (as before).\n Changes to temporary tables are only binlogged if and only if the CREATE was logged. The logging happens under STATEMENT or MIXED. If binlog_format=ROW, temporary table changes are not binlogged. A temporary table that is changed under ROW is marked as ''not up to date in binlog'' and no future row changes are logged. Any usage of this temporary table will force row logging of other tables in any future statements using the temporary table to be row logged.\n DROP TEMPORARY is binlogged only if the CREATE was binlogged.\n\nIn some contexts, temporary tables on the master and slave can become inconsistent.\\\nOne example is if a temporary table is updated with the value of a non deterministic function like UUID(), in which the change is never sent to the slave.\n\nIn some other contexts, while using MIXED mode, all changes will be logged in ROW mode while the user has any active temporary tables, even if the temporary tables are not used in the query. This depends on in which format some previous independent commands were logged.\n\nThere are many other pitfalls with logging temporary table to the slave.\n\nCREATE TABLE ... LIKE\n\nUse the LIKE clause instead of a full table definition to create an empty table with the same definition as another table, including columns, indexes, and table options. Foreign key definitions, as well as any DATA DIRECTORY or INDEX DIRECTORY table options specified on the original table, will not be created.\n\nLIKE does not preserve the TEMPORARY status of the original table. To make the new table TEMPORARY as well, use CREATE TEMPORARY TABLE ... LIKE.\n\nLIKE does not work with views, only base tables. Attempting to use it on a view will result in an error:\n\n`sql\nCREATE VIEW v (mycol) AS SELECT ''abc'';\n\nCREATE TABLE v2 LIKE v;\nERROR 1347 (HY000): ''test.v'' is not of type ''BASE TABLE''\n`\n\nThe same version of the table storage format as found in the original table is used for the new table.\n\nCREATE TABLE ... LIKE performs the same checks as CREATE TABLE. So a statement may fail if a change in the SQL_MODE renders it invalid. For example:\n\n`sql\nCREATE OR REPLACE TABLE x (d DATE DEFAULT ''0000-00-00'');\n\nSET SQL_MODE=''NO_ZERO_DATE'';\n\nCREATE OR REPLACE TABLE y LIKE x;\nERROR 1067 (42000): Invalid default value for ''d''\n`\n\nCREATE TABLE ... SELECT\n\nYou can create a table containing data from other tables using the CREATE ... SELECT statement. Columns will be created in the table for each field returned by the SELECT query.\n\nYou can also define some columns normally and add other columns from a SELECT. You can also create columns in the normal way and assign them some values using the query, this is done to force a certain type or other field characteristics. The columns that are not named in the query will be placed before the others. For example:\n\n`sql\nCREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM\n    SELECT 5 AS b, c, d FROM another_table;\n`\n\nRemember that the query just returns data. If you want to use the same indexes or the same column attributes ([NOT] NULL, DEFAULT, AUTO_INCREMENT, CHECK constraints) in the new table, you need to specify them manually. Types and sizes are not automatically preserved if no data is returned by the SELECT that requires the full size, and VARCHAR could be converted into CHAR. The CAST() function can be used to force the new table to use certain types.\n\nAliases (AS) are taken into account, and they should always be used when you SELECT an expression (function, arithmetical operation, etc.).\n\nIf an error occurs during the query, the table will not be created at all.\n\nIf the new table has a primary key or UNIQUE indexes, you can use the IGNORE or REPLACE keywords to handle duplicate key errors during the query. IGNORE means that the newer values must not be inserted if an identical value exists in the index. REPLACE means that older values must be overwritten.\n\nIf the columns in the new table are more than the rows returned by the query, the columns populated by the query will be placed after the other columns. Note that if the strict SQL_MODE is on, and the columns that are not named in the query do not have a DEFAULT value, an error will be raised and no rows will be copied.\n\nConcurrent inserts are not used during the execution of a CREATE ... SELECT.\n\nIf the table already exists, an error similar to the following will be returned:\n\n`\nERROR 1050 (42S01): Table ''t'' already exists\n`\n\nIf the IF NOT EXISTS clause is used, and the table exists, a note will be produced instead of an error.\n\nTo insert rows from a query into an existing table, INSERT ... SELECT can be used.\n\nColumn Definitions\n\n<pre class="language-bnf"><code class="lang-bnf">create_definition:\n  { col_name column_definition | <a data-footnote-ref href="#user-content-fn-5">index_definition</a> | <a data-footnote-ref href="#user-content-fn-4">period_definition</a> | CHECK (expr) }\n\ncolumn_definition:\n  <a data-footnote-ref href="#user-content-fn-6">data_type</a>\n    [NOT NULL | NULL] [DEFAULT default_value | (expression)]\n    [ON UPDATE [NOW | CURRENT_TIMESTAMP] [(precision)]]\n    [AUTO_INCREMENT] [ZEROFILL] [UNIQUE [KEY] | [PRIMARY] KEY]\n    [INVISIBLE] [{WITH|WITHOUT} SYSTEM VERSIONING]\n    [COMMENT ''string''] [REF_SYSTEM_ID = value]\n    [<a data-footnote-ref href="#user-content-fn-5">reference_definition</a>]\n  | <a data-footnote-ref href="#user-content-fn-6">data_type</a> [GENERATED ALWAYS] \n  AS [ ROW {START|END} [NOT NULL ENABLE] [[PRIMARY] KEY]\n        | (expression) [VIRTUAL | PERSISTENT | STORED] ]\n      [INVISIBLE] [UNIQUE [KEY]] [COMMENT ''string'']\n\nconstraint_definition:\n   CONSTRAINT [constraint_name] CHECK (expression)\n</code></pre>\n\nNote:\n\nMariaDB accepts the shortcut format with a REFERENCES clause only in ALTER TABLE and CREATE TABLE statements, but that syntax does nothing. For example:\n\n`sql\nCREATE TABLE b(for_key INT REFERENCES a(not_key));\n`\n\nMariaDB will attempt to apply the constraint. See Foreign Keys examples.\n\nMariaDB accepts the shortcut format with a REFERENCES clause only in ALTER TABLE and CREATE TABLE statements, but that syntax does nothing. For example:\n\n`sql\nCREATE TABLE b(for_key INT REFERENCES a(not_key));\n`\n\nEach definition either creates a column in the table or specifies an index or constraint on one or more columns. See Indexes below for details on creating indexes.\n\nCreate a column by specifying a column name and a data type, optionally followed by column options. See Data Types for a full list of data types allowed in MariaDB.\n\nNULL and NOT NULL\n\nUse the NULL or NOT NULL options to specify that values in the column may or may not be NULL, respectively. By default, values may be NULL. See also NULL Values in MariaDB.\n\nDEFAULT Column Option\n\nSpecify a default value using the DEFAULT clause. If you don''t specify DEFAULT then the following rules apply:\n\n If the column is not defined with NOT NULL, AUTO_INCREMENT or TIMESTAMP, an explicit DEFAULT NULL will be added.\\\n  Note that in MySQL, you may get an explicit DEFAULT for primary key parts, if not specified with NOT NULL.\n\nThe default value will be used if you INSERT a row without specifying a value for that column, or if you specify DEFAULT for that column.\n\nCURRENT_TIMESTAMP may also be used as the default value for a DATETIME\n\nYou can use most functions in DEFAULT. Expressions should have parentheses around them. If you use a non deterministic function in DEFAULT then all inserts to the table will be replicated in row mode. You can even refer to earlier columns in the DEFAULT expression (excluding AUTO_INCREMENT columns):\n\n`sql\nCREATE TABLE t1 (a INT DEFAULT (1+1), b INT DEFAULT (a+1));\nCREATE TABLE t2 (a BIGINT PRIMARY KEY DEFAULT UUID_SHORT());\n`\n\nThe DEFAULT clause cannot contain any stored functions or subqueries, and a column used in the clause must already have been defined earlier in the statement.\n\nIt is possible to assign BLOB or TEXT columns a DEFAULT value.\n\nYou can also use DEFAULT (NEXT VALUE FOR sequence).\n\nAUTO_INCREMENT Column Option\n\nUse AUTO_INCREMENT to create a column whose value can be set automatically from a simple counter. You can only use AUTO_INCREMENT on a column with an integer type. The column must be a key, and there can only be one AUTO_INCREMENT column in a table. If you insert a row without specifying a value for that column (or if you specify 0, NULL, or DEFAULT as the value), the actual value will be taken from the counter, with each insertion incrementing the counter by one. You can still insert a value explicitly. If you insert a value that is greater than the current counter value, the counter is\\\nset based on the new value. An AUTO_INCREMENT column is implicitly NOT NULL. Use LAST_INSERT_ID to get the AUTO_INCREMENT value most recently used by an INSERT statement.\n\nZEROFILL Column Option\n\nIf the ZEROFILL column option is specified for a column using a numeric data type, then 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, INTERSECT, or EXCEPT. ZEROFILL is a non-standard MariaDB and MySQL extension.\n\nPRIMARY KEY Column Option\n\nUse PRIMARY KEY to make a column a primary key. A primary key is a special type of a unique key. There can be at most one primary key per table, and it is implicitly NOT NULL.\n\nSpecifying a column as a unique key creates a unique index on that column. See the Index Definitions section below for more information.\n\nUNIQUE KEY Column Option\n\nUse UNIQUE KEY (or just UNIQUE) to specify that all values in the column must be distinct from each other. Unless the column is NOT NULL, there may be multiple rows with NULL in the column.\n\n`\n`\n\nWhen any inserts or updates occur in the table, reading the binlog shows the hidden column (@3). it causes confusion for the user; we can document these behaviours.\n\n`\nINSERT INTO securedb.t_long_keys\nSET\n@1=1 / INT meta=0 nullable=0 is_null=0 /\n@2=''a'' / VARSTRING(4073) meta=4073 nullable=1 is_null=0 /\n@3=580 / LONGINT meta=0 nullable=1 is_null=0 /\n`\n\n`sql\nCREATE TABLE t_long_keys (   a INT PRIMARY KEY,   b  VARCHAR(4073),   UNIQUE KEY uk_b (b) ) ENGINE=InnoDB;\nQuery OK, 0 r\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-table');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (630, 39, 'CREATE TABLESPACE', 'Description\n-----------\n\nThe CREATE TABLESPACE statement is not supported by MariaDB. It was originally inherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is also supported for InnoDB. However, MariaDB has chosen not to include that specific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-tablespace', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-tablespace');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (631, 39, 'Generated Columns', 'Syntax\n------\n\n<type>  [GENERATED ALWAYS]  AS   ( <expression> )\n[VIRTUAL | PERSISTENT | STORED]  [UNIQUE] [UNIQUE KEY] [COMMENT <text>]\n\nDescription\n-----------\n\nA generated column is a column in a table that cannot explicitly be set to a specific value in a DML query. Instead, its value is automatically generated based on an expression. This expression might generate the value based on the values of other columns in the table, or it might generate the value by calling built-in functions or user-defined functions (UDFs).\n\nThere are two types of generated columns:\n\n PERSISTENT (a.k.a. STORED): This type''s value is actually stored in the table.\n VIRTUAL: This type''s value is not stored at all. Instead, the value is generated dynamically when the table is queried. This type is the default.\n\nGenerated columns are also sometimes called computed columns or virtual columns.\n\nSupported Features\n\nStorage Engine Support\n\n Generated columns can only be used with storage engines which support them. If you try to use a storage engine that does not support them, then you will see an error similar to the following:\n\n``sql\nERROR 1910 (HY000): TokuDB storage engine does not support computed columns\n`\n\n InnoDB, Aria, MyISAM and CONNECT support generated columns.\n A column in a MERGE table can be built on a PERSISTENT generated column.\n   However, a column in a MERGE table can not be defined as a VIRTUAL and PERSISTENT generated column.\n\nData Type Support\n\nAll data types are supported when defining generated columns.\n\nUsing the ZEROFILL column option is supported when defining generated columns.\n\nUsing the AUTO_INCREMENT column option is not supported when defining generated columns.\n\nUsing the AUTO_INCREMENT column option is supported when defining generated columns.\n\nIt does not work correctly, though. See MDEV-11117.\n\nIndex Support\n\nUsing a generated column as a table''s primary key is not supported. See MDEV-5590 for more information. If you try to use one as a primary key, then you will see an error similar to the following:\n\n`sql\nERROR 1903 (HY000): Primary key cannot be defined upon a computed column\n`\n\nUsing PERSISTENT generated columns as part of a foreign key is supported.\n\nReferencing PERSISTENT generated columns as part of a foreign key is also supported.\n\nHowever, using the ON UPDATE CASCADE, ON UPDATE SET NULL, or ON DELETE SET NULL clauses is not supported. If you try to use an unsupported clause, then you will see an error similar to the following:\n\n`sql\nERROR 1905 (HY000): Cannot define foreign key with ON UPDATE SET NULL clause on a computed column\n`\n\nDefining indexes on both VIRTUAL and PERSISTENT generated columns is supported.\n\nIf an index is defined on a generated column, then the optimizer considers using it in the same way as indexes based on "real" columns.\n\nThe optimizer can recognize use of indexed virtual column expressions in the WHERE clause and use them to construct range and ref(const) accesses. See Virtual Column Support in the Optimizer.\n\nThe optimizer cannot recognize use of indexed virtual column expressions in the WHERE clause and use them to construct range and ref(const) accesses. See Virtual Column Support in the Optimizer.\n\nStatement Support\n\nGenerated columns are used in DML queries just as if they were "real" columns.\n\n However, VIRTUAL and PERSISTENT generated columns differ in how their data is stored.\n   Values for PERSISTENT generated columns are generated whenever a DML queries inserts or updates the row with the special DEFAULT value. This generates the columns value, and it is stored in the table like the other "real" columns. This value can be read by other DML queries just like the other "real" columns.\n   Values for VIRTUAL generated columns are not stored in the table. Instead, the value is generated dynamically whenever the column is queried. If other columns in a row are queried, but the VIRTUAL generated column is not one of the queried columns, then the column''s value is not generated.\n\nThe SELECT statement supports generated columns.\n\nGenerated columns can be referenced in the INSERT, UPDATE, and DELETE statements.\n\n However, VIRTUAL or PERSISTENT generated columns cannot be explicitly set to any other values than NULL or DEFAULT. If a generated column is explicitly set to any other value, then the outcome depends on whether strict mode is enabled in sql_mode. If it is not enabled, then a warning will be raised and the default generated value will be used instead. If it is enabled, then an error will be raised instead.\n\nThe CREATE TABLE statement has limited support for generated columns.\n\n It supports defining generated columns in a new table.\n It supports using generated columns to partition tables.\n It does not support using the versioning clauses with generated columns.\n\nThe ALTER TABLE statement has limited support for generated columns.\n\n It supports the MODIFY and CHANGE clauses for PERSISTENT generated columns.\n It does not support the MODIFY clause for VIRTUAL generated columns if ALGORITHM is not set to COPY. See MDEV-15476 for more information.\n It does not support the CHANGE clause for VIRTUAL generated columns if ALGORITHM is not set to COPY. See MDEV-17035 for more information.\n It does not support altering a table if ALGORITHM is not set to COPY if the table has a VIRTUAL generated column that is indexed. See MDEV-14046 for more information.\n It does not support adding a VIRTUAL generated column with the ADD clause if the same statement is also adding other columns if ALGORITHM is not set to COPY. See MDEV-17468 for more information.\n It also does not support altering an existing column into a VIRTUAL generated column.\n It supports using generated columns to partition tables.\n It does not support using the versioning clauses with generated columns.\n\nThe SHOW CREATE TABLE statement supports generated columns.\n\nThe DESCRIBE statement can be used to check whether a table has generated columns.\n\n You can tell which columns are generated by looking for the ones where the Extra column is set to either VIRTUAL or PERSISTENT. For example:\n\n`sql\nDESCRIBE table1;\n+-------+-------------+------+-----+---------+------------+\n| Field | Type        | Null | Key | Default | Extra      |\n+-------+-------------+------+-----+---------+------------+\n| a     | int(11)     | NO   |     | NULL    |            |\n| b     | varchar(32) | YES  |     | NULL    |            |\n| c     | int(11)     | YES  |     | NULL    | VIRTUAL    |\n| d     | varchar(5)  | YES  |     | NULL    | PERSISTENT |\n+-------+-------------+------+-----+---------+------------+\n`\n\nGenerated columns can be properly referenced in the NEW and OLD rows in triggers.\n\nStored procedures support generated columns.\n\nThe HANDLER statement supports generated columns.\n\nExpression Support\n\nMost legal, deterministic expressions which can be calculated are supported in expressions for generated columns.\n\nMost built-in functions are supported in expressions for generated columns.\n\n However, some built-in functions can''t be supported for technical reasons. For example, If you try to use an unsupported function in an expression, an error is generated similar to the following:\n\n`sql\nERROR 1901 (HY000): Function or expression ''dayname()'' cannot be used in the GENERATED ALWAYS AS clause of v\n`\n\nSubqueries are not supported in expressions for generated columns because the underlying data can change.\n\nUsing anything that depends on data outside the row is not supported in expressions for generated columns.\n\nStored functions are not supported in expressions for generated columns. See MDEV-17587 for more information.\n\nNon-deterministic built-in functions are supported in expressions for not indexed VIRTUAL generated columns.\n\nNon-deterministic built-in functions are not supported in expressions for PERSISTENT or indexed VIRTUAL generated columns.\n\nUser-defined functions (UDFs) are supported in expressions for generated columns.\n\n However, MariaDB can''t check whether a UDF is deterministic, so it is up to the user to be sure that they do not use non-deterministic UDFs with VIRTUAL generated columns.\n\nDefining a generated column based on other generated columns defined before it in the table definition is supported. For example:\n\n`sql\nCREATE TABLE t1 (a INT AS (1), b INT AS (a));\n`\n\nHowever, defining a generated column based on other generated columns defined after in the table definition is not supported in expressions for generation columns because generated columns are calculated in the order they are defined.\n\nUsing an expression that exceeds 255 characters in length is supported in expressions for generated columns. The new limit for the entire table definition, including all expressions for generated columns, is 65,535 bytes.\n\nUsing constant expressions is supported in expressions for generated columns. For example:\n\n`sql\nCREATE TABLE t1 (a int as (1));\n`\n\nMaking Stored Values Consistent\n\nWhen a generated column is PERSISTENT or indexed, the value of the expression needs to be consistent regardless of the SQL Mode flags in the current session. If it is not, then the table will be seen as corrupted when the value that should actually be returned by the computed expression and the value that was previously stored and/or indexed using a different sql_mode setting disagree.\n\nThere are currently two affected classes of inconsistencies: character padding and unsigned subtraction:\n\n For a VARCHAR or TEXT generated column the length of the value returned can vary depending on the PAD_CHAR_TO_FULL_LENGTH sql_mode flag. To make the value consistent, create the generated column using an RTRIM() or RPAD() function. Alternately, create the generated column as a CHAR column so that its data is always fully padded.\n If a SIGNED generated column is based on the subtraction of an UNSIGNED value, the resulting value can vary depending on how large the value is and the NO_UNSIGNED_SUBTRACTION sql_mode flag. To make the value consistent, use CAST() to ensure that each UNSIGNED operand is SIGNED before the subtraction.\n\nA fatal error is generated when trying to create a generated column whose value can change depending on the SQL Mode when its data is PERSISTENT or indexed. For an existing generated column that has a potentially inconsistent value, a warning about a bad expression is generated the first time it is used (if warnings are enabled).\n\nFor an existing generated column that has a potentially inconsistent value, a warning about a bad expression is generated the first time it is used (if warnings are enabled).\n\nA potentially inconsistent generated column outputs a warning when created or first used (without restricting the creation).\n\nA potentially inconsistent generated column does not output a warning when created or first used.\n\nHere is an example of two tables that are warned about:\n\n`sql\nCREATE TABLE bad_pad (\n  txt CHAR(5),\n  -- CHAR -> VARCHAR or CHAR -> TEXT can''t be persistent or indexed:\n  vtxt VARCHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE bad_sub (\n  num1 BIGINT UNSIGNED,\n  num2 BIGINT UNSIGNED,\n  -- The resulting value can vary for some large values\n  vnum BIGINT AS (num1 - num2) VIRTUAL,\n  KEY(vnum)\n);\n`\n\nThe warnings look like this:\n\n`sql\nWarning (Code 1901): Function or expression ''txt'' cannot be used in the GENERATED ALWAYS AS clause of vtxt\nWarning (Code 1105): Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH\n\nWarning (Code 1901): Function or expression ''num1 - num2'' cannot be used in the GENERATED ALWAYS AS clause of vnum\nWarning (Code 1105): Expression depends on the @@sql_mode value NO_UNSIGNED_SUBTRACTION\n`\n\nTo work around the issue, force the padding or type to make the generated column''s expression return a consistent value. For example:\n\n`sql\nCREATE TABLE good_pad (\n  txt CHAR(5),\n  -- Using RTRIM() or RPAD() makes the value consistent:\n  vtxt VARCHAR(5) AS (RTRIM(txt)) PERSISTENT,\n  -- When not persistent or indexed, it is OK for the value to vary by mode:\n  vtxt2 VARCHAR(5) AS (txt) VIRTUAL,\n  -- CHAR -> CHAR is always OK:\n  txt2 CHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE good_sub (\n  num1 BIGINT UNSIGNED,\n  num2 BIGINT UNSIGNED,\n  -- The indexed value will always be consistent in this expression:\n  vnum BIGINT AS (CAST(num1 AS SIGNED) - CAST(num2 AS SIGNED)) VIRTUAL,\n  KEY(vnum)\n);\n`\n\nHere is an example of two tables whose creation is rejected:\n\n`sql\nCREATE TABLE bad_pad (\n  txt CHAR(5),\n  -- CHAR -> VARCHAR or CHAR -> TEXT can''t be persistent or indexed:\n  vtxt VARCHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE bad_sub (\n  num1 BIGINT UNSIGNED,\n  num2 BIGINT UNSIGNED,\n  -- The resulting value can vary for some large values\n  vnum BIGINT AS (num1 - num2) VIRTUAL,\n  KEY(vnum)\n);\n`\n\nMySQL Compatibility Support\n\n The STORED keyword is supported as an alias for the PERSISTENT keyword.\n Tables created with MySQL 5.7 or later that contain MySQL''s generated columns can be imported into MariaDB without a dump and restore.\n\nImplementation Differences\n\nGenerated columns are subject to various constraints in other DBMSs that are not present in MariaDB''s implementation. Generated columns may also be called computed columns or virtual columns in different implementations. The various details for a specific implementation can be found in the documentation for each specific DBMS.\n\nImplementation Differences Compared to Microsoft SQL Server\n\nMariaDB''s generated columns implementation does not enforce the following\\\nrestrictions that are present in Microsoft SQL Server''s computed columns implementation:\n\n MariaDB allows server variables in generated column expressions, including those that change dynamically, such as warning_count.\n MariaDB allows the CONVERT_TZ() function to be called with a named time zone as an argument, even though time zone names and time offsets are configurable.\n MariaDB allows the CAST() function to be used with non-unicode character sets, even though character sets are configurable and differ between binaries/versions.\n MariaDB allows FLOAT expressions to be used in generated columns. Microsoft SQL Server considers these expressions to be "imprecise" due to potential cross-platform differences in floating-point implementations and precision.\n Microsoft SQL Server requires the ARITHABORT mode to be set, so that division by zero returns an error, and not a NULL.\n Microsoft SQL Server requires QUOTED_IDENTIFIER to be set in sql_mode. In MariaDB, if data is inserted without ANSI_QUOTES` set in sql_mode, then it will be processed and stored differently in a generated column that contains quoted identifiers.\n\nMicrosoft SQL Server enforces the above restrictions by doing one of the following things:\n\n Refusing to create computed columns.\n Refusing to allow updates to a table containing them.\n* Refusing to use an index over such a column if it can not be guaranteed that the expression is fully deterministic.\n\nIn MariaDB, as long as the sql_mode, language, and other settings that were in effect duri\n\n[Truncated — full content at mariadb.com/docs]', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/generated-columns');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (632, 39, 'Invisible Columns', 'Description\n-----------\n\nInvisible columns (sometimes also called hidden columns) are hidden in certain contexts.\n\nColumns can be given an INVISIBLE attribute in a CREATE TABLE or ALTER TABLE statement. These columns will then not be listed in the results of a SELECT \\ statement, nor do they need to be assigned a value in an INSERT statement, unless INSERT explicitly mentions them by name.\n\nSince SELECT  does not return the invisible columns, new tables or views created in this manner will have no trace of the invisible columns. If specifically referenced in the SELECT statement, the columns will be brought into the view/new table, but the INVISIBLE attribute will not.\n\nInvisible columns can be declared as NOT NULL, but then require a DEFAULT value.\n\nIt is not possible for all columns in a table to be invisible.\n\nExamples\n--------\n\nCREATE TABLE t (x INT INVISIBLE);\nERROR 1113 (42000): A table must have at least 1 column\n\nCREATE TABLE t (x INT, y INT INVISIBLE, z INT INVISIBLE NOT NULL);\nERROR 4106 (HY000): Invisible column z must have a default value\n\nCREATE TABLE t (x INT, y INT INVISIBLE, z INT INVISIBLE NOT NULL DEFAULT 4);\n\nINSERT INTO t VALUES (1),(2);\n\nINSERT INTO t (x,y) VALUES (3,33);\n\nSELECT * FROM t;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nSELECT x,y,z FROM t;\n+------+------+---+\n| x    | y    | z |\n+------+------+---+\n|    1 | NULL | 4 |\n|    2 | NULL | 4 |\n|    3 |   33 | 4 |\n+------+------+---+\n\nDESC t;\n+-------+---------+------+-----+---------+-----------+\n| Field | Type    | Null | Key | Default | Extra     |\n+-------+---------+------+-----+---------+-----------+\n| x     | int(11) | YES  |     | NULL    |           |\n| y     | int(11) | YES  |     | NULL    | INVISIBLE |\n| z     | int(11) | NO   |     | 4       | INVISIBLE |\n+-------+---------+------+-----+---------+-----------+\n\nALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL DEFAULT 4;\n\nDESC t;\n+-------+---------+------+-----+---------+-----------+\n| Field | Type    | Null | Key | Default | Extra     |\n+-------+---------+------+-----+---------+-----------+\n| x     | int(11) | YES  |     | NULL    | INVISIBLE |\n| y     | int(11) | YES  |     | NULL    |           |\n| z     | int(11) | NO   |     | 4       |           |\n+-------+---------+------+-----+---------+-----------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/invisible-columns', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/invisible-columns');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (633, 39, 'Silent Column Changes', 'Description\n-----------\n\nWhen a CREATE TABLE or ALTER TABLE command is issued, MariaDB silently changes a column specification in the following cases:\n\n PRIMARY KEY columns are always NOT NULL.\n Any trailing spaces from SET and ENUM values are discarded.\n TIMESTAMP columns are always NOT NULL, and display sizes are discarded.\n A row-size limit of 65535 bytes applies.\n If strict SQL mode is not enabled (by default, it is), a VARCHAR column longer than 65535 become TEXT, and a VARBINARY columns longer than 65535 becomes a BLOB. If strict mode is enabled the silent changes will not be made, and an error will occur.\n If a USING clause specifies an index that''s not permitted by the storage engine, the engine will instead use another available index type that can be applied without affecting results.\n* If the CHARACTER SET binary attribute is specified, the column is created as the matching binary data type. A TEXT becomes a BLOB, CHAR a BINARY and VARCHAR a VARBINARY. ENUMs and SETs are created as defined.\n\nTo ease imports from other RDBMSs, MariaDB also silently maps the following data types:\n\n| Other Vendor Type    | MariaDB Type                                                      |\n| -------------------- | ----------------------------------------------------------------- |\n| BOOL                 | TINYINT      |\n| BOOLEAN              | TINYINT      |\n| CHARACTER VARYING(M) | VARCHAR(M)    |\n| FIXED                | DECIMAL      |\n| FLOAT4               | FLOAT          |\n| FLOAT8               | DOUBLE        |\n| INT1                 | TINYINT      |\n| INT2                 | SMALLINT    |\n| INT3                 | MEDIUMINT  |\n| INT4                 | INT              |\n| INT8                 | BIGINT        |\n| LONG VARBINARY       | MEDIUMBLOB |\n| LONG VARCHAR         | MEDIUMTEXT |\n| LONG                 | MEDIUMTEXT |\n| MIDDLEINT            | MEDIUMINT  |\n| NUMERIC              | DECIMAL      |\n\nCurrently, all MySQL types are supported in MariaDB.\n\nFor type mapping between Cassandra and MariaDB, see Cassandra storage engine.\n\nExamples\n--------\n\nCREATE TABLE SilenceIsGolden\n   (\n    f1 TEXT CHARACTER SET BINARY,\n    f2 VARCHAR(15) CHARACTER SET BINARY,\n    f3 CHAR CHARACTER SET BINARY,\n    f4 ENUM(''x'',''y'',''z'') CHARACTER SET BINARY,\n    f5 VARCHAR (65536),\n    f6 VARBINARY (65536),\n    f7 INT1\n   );\nQuery OK, 0 rows affected, 2 warnings (0.31 sec)\n\nSHOW WARNINGS;\n+-------+------+-----------------------------------------------+\n| Level | Code | Message                                       |\n+-------+------+-----------------------------------------------+\n| Note  | 1246 | Converting column ''f5'' from VARCHAR to TEXT   |\n| Note  | 1246 | Converting column ''f6'' from VARBINARY to BLOB |\n+-------+------+-----------------------------------------------+\n\nDESCRIBE SilenceIsGolden;\n+-------+-------------------+------+-----+---------+-------+\n| Field | Type              | Null | Key | Default | Extra |\n+-------+-------------------+------+-----+---------+-------+\n| f1    | blob              | YES  |     | NULL    |       |\n| f2    | varbinary(15)     | YES  |     | NULL    |       |\n| f3    | binary(1)         | YES  |     | NULL    |       |\n| f4    | enum(''x'',''y'',''z'') | YES  |     | NULL    |       |\n| f5    | mediumtext        | YES  |     | NULL    |       |\n| f6    | mediumblob        | YES  |     | NULL    |       |\n| f7    | tinyint(4)        | YES  |     | NULL    |       |\n+-------+-------------------+------+-----+---------+-------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/silent-column-changes', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/silent-column-changes');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (634, 39, 'DROP DATABASE', 'Syntax\n------\n\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDescription\n-----------\n\nDROP DATABASE drops all tables in the database and deletes the database. Be very careful with this statement! To use DROP DATABASE, you need the DROP privilege on the database. DROP SCHEMA is a synonym for DROP DATABASE.\n\nImportant: When a database is dropped, user privileges on the database are not automatically dropped. See GRANT.\n\nIF EXISTS\n\nUse IF EXISTS to prevent an error from occurring for databases that do not exist. A NOTE is generated for each non-existent database when using IF EXISTS. See SHOW WARNINGS.\n\nAtomic DDL\n\nMariaDB 10.6.1 supports Atomic DDL.DROP DATABASE is implemented as\n\n``sql\nLOOP OVER ALL tables\n  DROP TABLE tbl\n`\n\nEach individual DROP TABLE is atomic while DROP DATABASE as a whole is crash-safe.\n\nAtomic DROP` is not available.\n\nExamples\n--------\n\nDROP DATABASE bufg;\nQuery OK, 0 rows affected (0.39 sec)\n\nDROP DATABASE bufg;\nERROR 1008 (HY000): Can''t drop database ''bufg''; database doesn''t exist\n\n \\W\nSHOW warnings enabled.\n\nDROP DATABASE IF EXISTS bufg;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\nNote (Code 1008): Can''t DROP DATABASE ''bufg''; DATABASE doesn''t exist\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-database', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-database');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (635, 39, 'DROP EVENT', 'Syntax\n------\n\nDROP EVENT [IF EXISTS] event_name\n\nDescription\n-----------\n\nThis statement drops the event named event_name. The event immediately ceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the errorERROR 1517 (HY000): Unknown event ''event_name'' results. You can override this and cause the statement to generate a NOTE for non-existent events instead by usingIF EXISTS. See SHOW WARNINGS.\n\nThis statement requires the EVENT privilege.\n\nExamples\n--------\n\nDROP EVENT myevent3;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-event', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-event');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (636, 39, 'DROP INDEX', 'Syntax\n------\n\nDROP INDEX [IF EXISTS] index_name ON tbl_name \n    [WAIT n |NOWAIT]\n\nDescription\n-----------\n\nDROP INDEX drops the index named index_name from the table tbl_name. This statement is mapped to an ALTER TABLE statement to drop the index.\n\nIf another connection is using the table, a metadata lock is active, and this statement will wait until the lock is released. This is also true for non-transactional tables.\n\nSee ALTER TABLE.\n\nAnother shortcut, CREATE INDEX, allows the creation of an index.\n\nTo remove the primary key, PRIMARY must be specified as index_name. Note that the quotes are necessary, because PRIMARY is a keyword.\n\nPrivileges\n\nExecuting the DROP INDEX statement requires the INDEX privilege for the table or the database.\n\nOnline DDL\n\nOnline DDL is used by default with InnoDB, when the drop index operation supports it.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nDROP INDEX IF EXISTS ...\n\nIf the IF EXISTS clause is used, then MariaDB will return a warning instead of an error if the index does not exist.\n\nWAIT/NOWAIT\n\nSets the lock wait timeout. See WAIT and NOWAIT.\n\nProgress Reporting\n\nMariaDB provides progress reporting for DROP INDEX statement for clients\\\nthat support the new progress reporting protocol. For example, if you were using the mariadb client, then the progress report might look like this::\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-index', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-index');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (637, 39, 'DROP LOGFILE GROUP', 'Description\n-----------\n\nThe DROP LOGFILE GROUP statement is not supported by MariaDB. It was originally inherited from MySQL NDB Cluster. See MDEV-19295 for more information.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-logfile-group', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-logfile-group');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (638, 39, 'DROP PACKAGE BODY', 'Syntax\n------\n\nDROP PACKAGE BODY [IF EXISTS]  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE BODY statement drops the package body (that is, the implementation) which was created using the CREATE PACKAGE BODY statement.\n\nNote, DROP PACKAGE BODY drops only the package implementation, but does not drop the package specification. Use DROP PACKAGE to drop the package entirely (i.e. both implementation and specification).\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package-body', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package-body');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (639, 39, 'DROP PACKAGE', 'Syntax\n------\n\nDROP PACKAGE [IF EXISTS]  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE statement drops a stored package entirely:\n\n Drops the package specification (earlier created using the CREATE PACKAGE statement).\n Drops the package implementation, if the implementation was already created using the CREATE PACKAGE BODY statement.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package');
INSERT INTO help_topic (help_topic_id, help_category_id, name, description, example, url) VALUES (640, 39, 'DROP SERVER', 'Syntax\n------\n\nDROP SERVER [ IF EXISTS ] server_name\n\nDescription\n-----------\n\nDrops the server definition for the server named _server_name_. The corresponding row within the mysql.servers table will be deleted. This statement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED ADMIN privilege.\n\nDropping a server for a table does not affect any FederatedX, FEDERATED, Connect or Spider tables that used this connection information when they were created.\n\nDROP SERVER is not written to the binary log, irrespective of the binary log format being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER, ALTER SERVER and DROP SERVER statements.\n\nIF EXISTS\n\nIf the IF EXISTS clause is used, MariaDB will not return an error if the server does not exist. Unlike all other statements, DROP SERVER IF EXISTS does not issue a note if the server does not exist. See MDEV-9400.\n\nExamples\n--------\n\nDROP SERVER s;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-server', '', 'https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-server');
